Errrrm, plant some c4 in your keyboard and detonate it?

In PS you just go window>history and can undo things from there, as for paint atleast use paint.net2