What to do right now
- Reopen VS Code with the same folder or workspace; Hot Exit normally restores unsaved editors by itself.
- If the tabs do not return, copy the Backups folder, usually %APPDATA%\Code\Backups, before VS Code starts again.
- For a saved file you overwrote, open it and check the Timeline view for Local History entries.
- If you closed an editor with Don't Save, its backup was deleted on purpose and only a deleted file scan may still find it.
Step by step
Reopen the same folder or workspace
Start VS Code and open the same folder or workspace you were using, for example with File, Open Recent. Backups belong to a specific window, so opening a different folder will not show them. Save restored editors immediately.
Check the Hot Exit setting
Open Settings and search for files.hotExit. The default, onExit, keeps unsaved editors when VS Code closes. If it was set to off, unsaved text was not backed up and the Backups folder will usually be empty.
Copy the Backups folder
Close VS Code. Paste %APPDATA%\Code\Backups into the File Explorer address bar and copy the whole folder somewhere else. Each subfolder belongs to one window and holds files for Untitled editors and modified files.
Read the backup files safely
Each backup file starts with one line holding the original path or untitled name, followed by your text. Open a copy in any text editor and delete that first line, or let the finder below do it for you.
Let the finder collect them
In FileFix Ultimate, open Find files lost when a program crashed or closed without saving and click Find unsaved files. Filter Program by Visual Studio Code. Items are named after the original file or Untitled tab, and Copy selected saves the text without the header line.
Use Local History for saved files
If you saved over good code, open the file in VS Code, expand Timeline in the Explorer side bar and pick an earlier Local History entry. You can compare it with the current version and restore it.
Hot Exit and Local History are not the same thing
Hot Exit is about text that was never saved. When you quit VS Code, close a window or the program crashes, it writes a backup of every dirty editor and restores it at the next start, without asking whether to save. The backup is removed once you save or discard the editor, so it only exists while changes are pending.
Local History is about saved text. Each time you save, VS Code can keep a copy of the previous version in its user data folder, usually under %APPDATA%\Code\User\History, and lists those copies in the Timeline view. It does not cover Untitled editors that were never saved to a file.
Why the tabs sometimes do not come back
Backups are tied to the folder or workspace of the window. Opening VS Code on a different folder, or with an empty window, shows nothing, although the backups may still be on disk. Settings sync, switching profiles, running Insiders instead of the stable version, or a portable installation also use different data folders; Insiders, for example, usually keeps its files under a Code - Insiders folder instead.
Cleanup tools that empty AppData, a reinstall that removes user data, and closing an editor with Don't Save are the usual reasons backups really disappear. Copy the Backups folder before trying several restarts.
When the code was in a Git repository
If the project uses Git, uncommitted changes are not in Git, but anything you committed or stashed can be restored there. Check the Source Control view and git stash list before anything else. For a deleted source file that was never committed, a deleted file scan of the drive is the remaining option.
When it won't work
- files.hotExit was set to off, so unsaved editors were never written to disk.
- The editor was closed with Don't Save and its deleted backup was overwritten or trimmed on an SSD.
- The VS Code user data folder was deleted by a cleanup tool or a reinstall that removed settings.
- Local History was disabled or its retention limit removed the version you need.
How FileFix Ultimate helps
- Finds VS Code Hot Exit backups in %APPDATA%\Code\Backups read-only, together with Notepad, Notepad++ and Office recovery files.
- Reads the original file path or Untitled name from each backup and uses it to suggest a file name.
- Copies the plain text without the backup header to a folder you choose.
- If backups were already deleted, Deleted file recovery can search drive C: for them and save results to another disk.
- Free for personal use and fully offline, so source code never leaves your PC.
FileFix Ultimate is free for personal use, works offline and never writes to the drive you are recovering from. Business use needs a one-year licence per PC. Check the signature before you run it.
Frequently asked questions
Where does VS Code store unsaved files?
For the standard installation, usually in %APPDATA%\Code\Backups, in one subfolder per window. Insiders and portable installations use their own data folders, so the path can differ.
Does VS Code keep Untitled tabs after a crash?
Usually yes, if files.hotExit is on, which is the default. Reopen the same window or workspace and the Untitled editors should come back. If not, copy the Backups folder first.
Can Local History bring back an Untitled file?
No. Local History records versions of files when they are saved. An Untitled editor that was never saved exists only in the Hot Exit backups.
How do I find an older saved version of a file in VS Code?
Open the file, expand Timeline in the Explorer side bar and choose a Local History entry. You can also run the command palette and search for Local History to find entries across files.