About six months ago I wrote a blog article about how to exclude files or folders from the System Restore database. You can read the whole article on my blog site.
At least 2 or 3 times I have had to use System Restore and not realized until it was too late that it had overridden changes I had made to product code. The magic trick is contained in two registry keys:
Once in a while I get Blue Screen of Death on my machine. Happens about every 3 months or so. I leave my machines on so they can have a pretty long uptime (longest I recall seeing between reboots was 116 days) When this happens and you opt to use the System Restore to get to an earlier restore point, you can be overwriting your code!
In January 2012 this happened to me on my old development machine and without realizing I overwrote a fair amount of new code, changes and fixes I had been making to Build Automator and couple of other products. With Build Automator I didn't notice this until couple of months later. This was just before I put it into version control (yeah, shame on me!) but I had the other products in SVN so I could recover them easily. There is nothing more irritating and down right aggravating than having bugs crop up in code again that you know you have already fixed!
Couple of weeks ago I had this happen on a VMware host machine when 3 virtual machines were running. For some reason the operating system on one of them insisted on doing a system fix, which includes a system restore. Of course this was the machine I was actively working on and I hadn't checked the project in the night before. I was moving on to a different project so the bulb didn't come on until my backup had been overwritten and I had lost some work. What made me realize it was that two entry fields on a screen I was working on were missing and couple of routines were no longer there. Fortunately it was a very minor loss, but never the less, it is definitely worth it to exclude files and folders that you do not want to be overwritten by System restore.
I'm now going through my virtual machines and making sure that I have the settings that I need for each one of them, so I don't have to risk this again.