If you use Java and you have no other way to get the code back, you could download the compiled binary off the roboRIO, and
decompile it. This should be a last resort because there will likely be a lot of work to actually bring the decompiled code to a functioning state and all your comments will be lost.
In the future, you should definitely use some kind of backup system, such as Dropbox or git (there are lots of benefits to using git).