On Wednesday, June 17th the Senate passed the Saving the OOI Act with unanimous consent. This bill prohibits dismantling the OOI. The bill had not yet passed the House.
For those unfamiliar, this implies they would have been able to override a presidential veto, so the administration backtracking is just saving the president the embarassment of a defiant congress/disunified party.
Trump cares about winning, and appearing invincible, a lot. That’s why in close races, he only endorses near the end when he’s sure who’s going to win.