2

my VSC crash without saving how to get back the code ? already tested appdata\roaming\code\backup i dont found the file

2

2 Answers 2

9

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"

4
  • You saved lots of my time. Thank you. Feb 11, 2023 at 15:43
  • On macOS, it's at ~/Library/Application Support/Code/User/History.
    – s3cur3
    Oct 19, 2023 at 16:31
  • 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
    – Issung
    Oct 24, 2023 at 7:42
  • wrong. this is for saved versions of the file. not the latest unsaved version.
    – starball
    Dec 15, 2023 at 8:57
0

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).

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .