President Trump's time in office has so far been marked by sudden reversals on key policy positions — from his opposition to the Export-Import Bank to his pledge to label China a currency manipulator.

Some flip-flops have been praiseworthy, while others are merely concessions to reality. Still, others suggest Trump isn't immune to the beguiling miasma rising from the Washington swamp.

In the category of praiseworthy are Trump's second thoughts about ditching the North American Free Trade Agreement, which has governed trade relations with Mexico and Canada for 23 years.

Trump has called it "one of the worst deals ever" and "a total disaster." He was set to announce withdrawal on his 100th day in office. Then he thought better of it.

As he was about to sign the document initiating withdrawal, Commerce Secretary Wilbur Ross and Agriculture Secretary Sonny Perdue showed him a map of all the areas in the U.S. that would be hard hit by withdrawal. Now Trump says he would like to renegotiate the pact rather than withdraw from it.

His sudden change of mind reinforces the understanding that he is erratic. But it also shows a willingness to listen and learn. NAFTA has brought millions of jobs and billions of dollars to the economy.

As Mark Vargas recently wrote in a Washington Examiner op-ed, trade with Mexico, our second-largest trade partner, comes to about $1 million traveling between the two economies every minute.

Most economists say NAFTA has been beneficial. It has hurt some communities, including some that voted overwhelmingly for Trump last November. But the damage attributed to it has been overblown. In many cases, automation, technology and trade with China have played bigger roles. Overall, NAFTA has made American businesses more competitive.

It's also helped mitigate problems that Trump promised to address. Free trade with Mexico is part of the reason why fewer Mexicans seek a better life in America. They don't have to, because free trade has helped create a life that's pretty good for most Mexicans.

Trump should renegotiate and modernize the trade deal. That can be done by, among other things, reforming the dispute-settlement process, eliminating barriers to digital trade, and ditching onerous environmental and labor mandates. Withdrawing from NAFTA would spark a trade war and leave all three countries worse off. Trump's reversal will anger some of his supporters, but it'll mean a better life for most.