Series 7: "Journey to the Center of the TARDIS"
In one of the worst stories of the Moffat era (at least in my opinion), the TARDIS gets salvaged by the Van Baalan bros, and all hell breaks loose. Even Clara learns the Doctor's real name. Then, with the "Big friendly button-ex Machina", the Doctor erases that day, and it never actually happened.
I'll add more if I find/remember them, but I feel like this is a prime example, and why the show should never do it again.
UPDATE:
Series 1: "Father's Day"
A good example of how trying to re-write history is a bad idea. Rose Tyler wants to go back in time to the day his father died. She gets all emotional, and saves his life. The reapers appear, never to be seen again. I think it was a good idea, but in the next 10 years it was never explored, nor explained again. At the end of the day, Rose's dad figured it out, and sacrificed himself so time could be stable again, so I'm not sure if it counts.
Series 4: "The Waters of Mars"
Another example of "one does not simply re-write history". The Tenth Doctor almost goes insane trying to save a crew of astronauts in Mars that had to die anyway. We get introduced to one of the most confusing concepts of New Doctor Who: Fixed points in time. Again, not sure if it counts.
As for Classic Doctor Who, I'm not very familiar with those stories, because they are so hard to find where I live. Let's wait if anybody can come up with examples of the classic era.