I didn't lose ALL my code but in 2006 about 1 week after presenting my RPG in the "help wanted" forum here on GameDev.net, my whole computer crashed and I lost most of my campaign editor and a lot of code improvement. I had a >1 year old backup but it was on a diskette, which should give you an idea of how much I lost. :(
I feel sorry for the people who answered my post and actually sent me stuff, I was so upset that I never answered emails after that. (I guess I'm a bit of an ass when I lose work, heh.)
Now, I host my project on a Git repository on Visual Studio Online with a backup on OneDrive and Google Drive so unless the Yellowstone supervolcano explodes and engulfs Sillicon Valley under a kilometer of hot magma, I should be safe. :)