idiom
turn the tables
invertir una situación y ganar ventaja
Meaning
to reverse a situation and gain the upper hand
Example
They were losing, but managed to **turn the tables** in the final round.
Estaban perdiendo, pero lograron **invertir la situación** en la ronda final.