i somehow manged to delete my sketch and i still have the code running on the board, is there any way to get it back?
You can’t (not as source)
What you can do is check your TEMP folder where the compiler stores intermediate results.
on windows this is something like C:\Users<your name>\AppData\Local\Temp
other platforms no idea, sorry