Did you never compile your code once? there is an option whereby it saves changed files on compile...
I tend to compile [not run] every time I complete a code block to see if any typos get flagged up...
Hmm, I guess all that you can scavange from all this is a few pointers I suppose...
A few from me would be...
Compile often, CTRL+S or Click Save/Save All often, Work from PSEUDO CODE to be able to keep track of what you are coding [kept in separate files outside of the DB files, maybe a text or word file] and last but not least
SAVE
SAVE
SAVE
I learned this the hard way through my graphic design days where the editor would just crash for no reason but I guess memory leaks... which can be dangerous as they can wipe out more data than you think sometimes... and ALWAYS ALWAYS save in versions... What I do is each day I return to my code, I copy the folder and name it something systematically such as date or version number after the project name...
I feel your pain, but maybe there is still some luck... right click the folder and click properties and see if you by chance have shadow copying enabled and see if you can recover a previous version... but as you likely did not click save, I guess this would be useless as you would just have what you have right now...
Oh, well... get coding! err and writing a map of your code structure!
Again... SAVE SAVE SAVE!