Rstudio project lost

I was working on the above project and it went to sleep whilst running something.
When I went to continue all my code and data were lost and my project was blank.

Is there anyway to recover my code and data?

Please please help

As an update to the above,

Session > Load Workspace shows me all of my saved files including my .R script file .RData file and .Rproj

However when I try to load any of these files I receive the following error messages

load("/cloud/project/project.Rproj")
Error in load("/cloud/project/project.Rproj") :
bad restore file magic number (file may be corrupted) -- no data loaded
In addition: Warning message:
file ‘project.Rproj’ has magic number 'Versi'
Use of save versions prior to 2 is deprecated

load("/cloud/project/epi_glm.R")
Error in load("/cloud/project/epi_glm.R") :
bad restore file magic number (file may be corrupted) -- no data loaded
In addition: Warning message:
file ‘epi_glm.R’ has magic number 'insta'
Use of save versions prior to 2 is deprecated

Is there any way to restore these files?

Any help appreciated

Hi @ChrisP,

I'm sorry for the trouble you're running into here.

I'm not sure if this will fix things for you, but the rsrecovr package might be able to help with unsaved files: GitHub - jmcphers/rsrecovr: RsRecovr: Recover unsaved files from RStudio sessions

If that's not the case for you (it sounds like your saved files are missing?), could you send a screenshot of what you're seeing in Posit Cloud? Is the File pane empty? What did you run to get the error messages you posted here? If you export your project are the files you expect to see in the export?

Mel

Hi @mel,

Thanks for getting in touch,

My current session was completely wiped, including script, console and environment. I was ultimately able to work around this by exporting earlier versions of saved files and continuing on RStudio desktop. I did lose a minimal amount of unsaved work but will take it as a lesson to regularly save and export in future!