You can't win your 2 weeks back, but ofcourse you use source control to roll back your code laugh.

If unit testing alone doesn't work out for you well enough, perhaps add code coverage? Haven't tried it, but seems to work for this sir:
http://www.ericsink.com/articles/Code_Coverage.html


Click and join the 3dgs irc community!
Room: #3dgs