turn the tables
Reverse a situation and gain the upper hand, as in Steffi won their previous three matches but today Mary turned the tables and prevailed. This expression alludes to the former practice of reversing the table or board in games such as chess, thereby switching the opponents' positions. [c. 1600]