Antimetabole
Antimetabole is a rhetorical device in which words or phrases are repeated and reversed in grammatical structure.
John F. Kennedy: "Ask not what your country can do for you—ask what you can do for your country."
Benjamin Franklin: "Eat to live, not live to eat."
Malcolm X: "We didn't land on Plymouth Rock; Plymouth Rock landed on us."
William Shakespeare's Hamlet:
"Fair is foul, and foul is fair."
“You forget what you want to remember, and you remember what you want to forget.”