Reputation: 76
I've been writing a .cpp file for two entire days now. It was just that one file, for an university project. So, I finally finished the code, and I decided to see if I could make a C interface to use it in C (generating the .o files with g++ and then linking them together to use with gcc). So I executed a g++ command which removed the .cpp!! (Cool, ahn?!)
It was opened in the VS Code, but the editor closed the file as soon as it was deleted (omg why?! worst design decision ever but whatever). Is there any way to recover the file? It's not in the recycle bin.
Upvotes: 3
Views: 11292
Reputation: 51
Another option would be to use Timeline feature:
AFAIK it saves versions every time file is saved (or for some other actions) in VSCode. So it might not work for files that you haven't edited.
Upvotes: 3
Reputation: 325
I was recently using VS Code server (i.e., SSH into remote machine) when I "Permanently Deleted" the wrong file. I was able to find it in /home/{username}/.vscode-server/data/User/History
under the temporary files & folders by looking at the most recently used items. Hope this helps someone else!
Upvotes: 2