my VSC crash without saving how to get back the code ? already tested appdata\roaming\code\backup i dont found the file
2 Answers
You can recover you projects from the VSCode cache.
In Linux it is located under /home/USER/.config/Code/User/History/
and under Windows it is /Users/USER/AppData/Roaming/Code/User/History/
.
Each file has a directory and in each directory there are different versions of the same file.
Edit: You can also just run the command (Ctrl+Shift+P) "Local History: Find Entry to Restore"
-
-
-
Saved me plenty pain, once in the windows folder with all the randomly named folders I made this bash command to find python files with a phrase I knew was in the file ("bootstrap"), for easy searching.
grep -rl "bootstrap" ./**/*.py
– IssungOct 24, 2023 at 7:42 -
wrong. this is for saved versions of the file. not the latest unsaved version.– starballDec 15, 2023 at 8:57
If you don't have backups, look in the Recycle Bin for possibly finding a deleted version of the file.
You could also set Windows Explorer to show hidden files and look in the folder where the file was last located. You may find there a version of it with a mangled name.
Look also in the temporary files folder (if in doubt run in the Command Prompt
the command set TEMP
).