Answer: regression
Regression is the defense mechanism of repressing thoughts of a traumatic or problematic event by reverting memory back to before it happened, so this is the closest one to the scenario in the answer.
Reaction formation is the mechanism in which a person does the opposite of what their impulse tells them to.