Maybe Mexico's "contingency plan" for President Trump is working out after all.

Mexico's currency, the peso, is one of the best performers in the world in February, up over 5%.

Before the U.S. election, the country's central bank started implementing what its governor, Agustin Carstens, called a "contingency plan." Carstens says Trump's potential policies would hit Mexico's economy like a "hurricane."

For ordinary Mexicans, the peso's momentum doesn't mean much. Gas prices rose as much as 20% in January while economic growth and wages continue to be sluggish. Life is getting more expensive.

Still, it's a swift turnaround for a country and currency facing an uncertain future with the U.S.

Since November, Mexico's central bank has raised interest rates three times and sold U.S. dollars to international investors. Among other efforts, it's all meant to buoy the peso that's been weighed down by Trump's threats.

"I think most people would tip their hat to Mr. Carstens," says Win Thin, head of emerging market currency strategy at Brown Brothers Harriman.

Related: Mexican leader warns tariffs 'will be a big mistake'

Trump's threats to potentially slap tariffs on Mexican imports and withdraw from NAFTA helped push the peso down to an all-time low in January.

But by mid-January, the peso began gaining value again.

A few factors outside of Banxico's contingency plan have also contributed to the peso's recent rise.

Investors believe the Federal Reserve may be waiting to hike rates for a few more months -- that's generally good news for developing countries like Mexico.

And Trump's cabinet members have recently tried to ease U.S.-Mexico relations, which have been battered by Trump's rhetoric. Some investors believe that's a sign that Trump may not follow through on his most severe threats.

Secretary of State Rex Tillerson and Homeland Security Secretary John Kelly met with Mexican leaders in Mexico City on Thursday and praised America's relationship with its southern neighbor.

Treasury Secretary Steven Mnuchin also spoke to Mexico's finance minister, Jose Antonio Meade, earlier this week and both stressed the importance of the countries' economic ties.

"It seems like Mnuchin and Tillerson are sort of the grownups in the room, taking a much more practical approach," says Thin. "That's helping to improve sentiment on Mexico."