The dollar reversed its losses and went positive Thursday, after President Donald Trump said the greenback will strengthen because of the growing U.S. economy and that his Treasury secretary's comments favoring a weak dollar were taken out of context.

Trump commented Thursday, in an interview with CNBC, after the dollar declined about 2 percent in two days to a three-year low. It began to fall sharply after Treasury Secretary Steven Mnuchin said a weak dollar is positive for trade in remarks at the World Economic Forum Wednesday.

Mnuchin attempted to clarify his remarks Thursday, but the currency market continued to react to Mnuchin's comments as though he was veering away from the dollar policy that's been in place since the 1990s.

"I think they were taken out of context, cause I read his exact statement and I'll tell you where I stand, which ultimately is very important," Trump said in the interview witih CNBC. "No. 1 I don't like talking about it because frankly nobody should be talking about it. It should be what it is, it should also be based on the strength of the country - we are doing so well. Our country is becoming so economically strong again and strong in other ways too, by the way that the dollar is going to get stronger and stronger and ultimately I want to see a strong dollar."

The full interview will air on 'Squawk Box' Friday at 6 a.m. ET.

The dollar index had been down more than a half percent Thursday, but erased those losses after Trump's comments aired on CNBC. It was at 89.29, higher by 0.1 percent on the day.

Trump's comment on the dollar was unusual in that presidents do not usually talk about the currency, but Trump was also unusual in that he spoke about dollar weakness last year, just several days before he was inaugurated. Strategists credit that remark with helping to turn the dollar into a weakening trend, and the dollar index has lost 11.3 percent over the past year.

"He's trying to tow the line. It looked like Trump was trying to walk back Mnuchin and reiterate a strong dollar policy. It remains to be seen if the actions back the words. It was a pretty clear endorsement of a strong dollar policy," said Tony Crescenzi, senior portfolio manager at Pimco. "If he said anything to oppose the dollar policy, its weakness would have intensified."

"It shows how sensitive the markets are around the discussion on U.S. dollar and trade in general," said Mark McCormick, North America head of foreign exchange strategy at TD Securities. "With the Trump administration, there's a lot of confusion around what the actual preference is."

The dollar swoon this week was even more pronounced because the U.S. had also just slapped tariffs on Asian-made washing machines and solar panels, raising fears of protectionism. That helped the dollar weakness gain momentum, as Mnuchin's comments were also perceived as trade-related.

"We've been leaning in this direction, where the dollar was stretched on the downside, and you needed a trigger to get the position squeeze going. That's what Trump did now. He's given everyone leeway to close their trade," said McCormick, pointing to a reversal in the euro which had been as high as $1.25. It was at $1.23 in late trading.

Some strategists said the Treasury secretary did not intend to alter U.S. policy, though his comments were less clear than prior Treasury officials, who had even if initially unclear, ultimately repeated with frequency that a strong dollar was in the best interest of the U.S.

A weak dollar could be initially good for exports and multinational profits, but could cause a decline in dollar assets, including Treasurys. This year, the U.S. is doubling the amount of debt it is issuing and will need to attract foreign buyers to the Treasury market.

Marc Chandler, head of fixed income strategy at Brown Brothers Harriman was in Davos at the time of Mnuchin's comments, and said attendees at the annual forum were confused by them. "I think they're unsure. Many people agreed with my interpretation that it's more incompetence than ill will."

He said the timing of the trade actions may be unrelated. "They've been pent up for awhile. They were expected," said Chandler. "My sense is the U.S. is not going to alter its dollar policy because of a meeting of the one percent in Switzerland."

David Woo, head of global rates and foreign exchange at Bank of America, also did not see Mnuchin's comments as signaling a shift in policy. "Rather, we see the statement in its entirety as reaffirming existing policy on the dollar as a reflection of US economic fundamentals, while acknowledging a more competitive USD valuation versus this time last year," he said in a note.

But Woo did say that other administrations have faced the same issue where the dollar is weakening and their policy is for strength.

"Treasury secretaries want to have their cake and eat it too," he said.

"If the U.S. economy were not doing well, I think this administration would be more prepared than previous administrations to weaken the dollar," he said.