Check the manual if codeblocks creates a secondary backup to the original. It might, who knows. Maybe one other simple thing to do if you know the first part of the file name is to do a search for that. You might be lucky.
However, restarting the computer is unlikely to cause deletion of files.
I don't know which version of Code Blocks you use, but the recent versions create a copy of the code files and the header files that you edit (after you saved then at least once of course).
For the file "main.cpp" the copy would be in the same directory and be called "main.cpp.save". Restoring "main.cpp" is just a mater of renaming "main.cpp.save".
This is done by the "Autosave" plugin and I believe it is activated by default (but I am not completely sure).