Content of .R file deleted after saving-Follow up

I got a similar question about the .R flile:

I am very sure I saved my .R file. Last night when I restart my computer and open Rstudio, one of my .R file back to two weeks ago version, a lot of new changes and updates has been gone. I checked other .R files, they are all fine. I am wondering what is the problem in here, the R? the Rstudio? my disk? or any setting? Is there anyway to find the new version of this .R file in somewhere?

One important point: it is this .R file that I used last before I restart my computer, and I am very sure it has been saved before I close the Rstudio. Any suggestions? Thanks

My system:
R 4.1.2
RStudio 2022.12.0+353 "Elsbeth Geranium" Release (7d165dcfc1b6d300eb247738db2c7076234f6ef0, 2022-12-03) for Ubuntu Jammy
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) rstudio/2022.12.0+353 Chrome/102.0.5005.167 Electron/19.1.3 Safari/537.36

Looks like this issue was fixed in subsequent updates to Rstudio (specifically build 492).

I would suggest updating Rstudio.

Sorry for your lost code :frowning:

Not going to fix the past, but going forward, I recommend you investigate the use of git to version control and backup your project code; github is free as an online host for it.

Thanks for the suggestion. Do you mean I need to reinstall the Rstudio? My Rstudio is the newest one.

Yes, definitely! I am setting it up now, hopefully it won't happen again. Thank you for your suggestion.

Here's the version I'm running right now. Not sure why Rstudio doesn't want to update for you.

RStudio 2023.03.0+386 "Cherry Blossom" Release (3c53477afb13ab959aeb5b34df1f10c237b256c3, 2023-03-09) for Windows
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) RStudio/2023.03.0+386 Chrome/108.0.5359.179 Electron/22.0.3 Safari/537.36