It didn't. Only the time travel was erased.
Lloyd is still older, Soto still came back to life, they still fought their clones.. etc. It all still happened, except for the time travel. The Mega Weapon still existed, until it got thrown into space.
The Grundle is the reason he used the tea.