Does anyone know where VS code saves unsaved files on a Windows machine?
I have found many discussions about this features, but they don't mention where the files are actually saved.
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.
Sign up to join this communityThe Microsoft help file indicates that the settings are stored in the folder:
Windows -
%APPDATA%\Code\User\
For me this translated to:
C:\Users\USERNAME\AppData\Roaming\Code\
In this folder I located a Backups
folder, this folder contained the raw data for my document. This appears to be grouped by date stored as a UNIX timestamp.
azuredatastudio
for code
in the searched path.
Aug 11, 2021 at 16:03
For Linux users they are found at ~/.config/Code/Backups
.
~/.config/Code - OSS/Backups
and ~/.config/Code - Insiders/Backups
for the open source version and the Insiders version, respectively.
Jun 29, 2019 at 1:49
~/.config/VSCodium/Backups
For Visual Studio Code on macOS, these files are found at:
~/Library/Application Support/Code/Backups
Insiders on macOS:
~/Library/Application Support/Code - Insiders/Backups
OSS on macOS:
~/Library/Application Support/Code - OSS/Backups
If you use scoop on Windows to manage your (portable) vscode installation, the backup path you're looking for is
%USERPROFILE%\scoop\persist\vscode-portable\data\user-data\backups
If all else fails, you may find part or all of your unsaved content in the following location:
C:\Users\USERNAME\AppData\Roaming\Code\User\History
I accidentally permanently deleted a file from my disk that didn't have any backup. Even tried those 3rd-party undelete tools, but couldn't find the file. Then I found this post and tried to locate an unsaved version, but there was none. Then just cruising through the directories I found location and therein was my content waiting to be discovered.
Note that VSCode uses hashed file names and there may be lots of subfolders in this location, so a manual find might be tedious. Instead you can open the entire History
folder in VSCode (Open Folder
command) and then use global text search to find your file(s). Also note that it stores several copies of each file over time, so u may want to cruise through found files to get the latest version.
Windows, Visual Studio 2019:
%localappdata%\Microsoft\VisualStudio\BackupFiles