7

Somehow all my User settings in VS Code have been reset and deleted and when I open the user settings JSON file I cannot find my previous settings.

How can I restore my previous versions of VS Code settings?

starball
  • 20,030
  • 7
  • 43
  • 238
Mohammad Alavi
  • 912
  • 1
  • 6
  • 16

4 Answers4

14

Check out Settings Sync for Visual Studio Code. Under restoring data, you should be able to restore previous versions of your VSCode settings.

In addition, Settings Sync: Show Synced Data from the command palette allows easy viewing of remote and local backups of your preferences.

  • On Windows/Linux Ctrl + Shift + P
  • On Mac Cmd + Shift + P

Note: Builds of Stable & Insiders pull from different Settings Sync services, occasionally leading to data compatibility issues.

TechSolomon
  • 425
  • 5
  • 12
6

I found the solution to this. You can access your previous of settings by the command Ctrl+Shift+P and then type >Settings Sync: Show Synced Data. VSCode will show you all your previous uploads of settings and you can copy and paste them to your current setting.json file and sync your settings again by >Settings Sync: Sync Now.

Mohammad Alavi
  • 912
  • 1
  • 6
  • 16
0

When I disabled settings sync I also picked the option to delete the cloud data, not knowing this would also delete my local settings file.

Because it's not in the cloud anymore I thought it was gone, but it turns out VS Code made a backup right before it deleted my local settings file.

I found that backup using: >Settings Sync: Open Local Backups Folder

/Users/username/Library/Application Support/Code/User/sync/settings

Eric Majerus
  • 1,099
  • 1
  • 12
  • 23
0

Try the other answers first, and then if none of them work, try this:

Try opening your user settings.json file by using the Preferences: Open User Settings (JSON) command in the command palette and then opening the file timeline for it (use the Explorer: Focus on Timeline View command in the command palette) to see if any record of it is saved in the timeline. If so, then you can restore previous versions from there. If not, and you haven't done anything else to keep backups of your config files (Ex. Git repo), then I think you're out of luck.

For keyboard shortcuts, you should be able to do similarly by opening the keybindings.json file with Preferences: Open Keyboard Shortcuts (JSON) in the command palette.

If you lost extensions too, check your .vscode/extensions directory in your user home directory. The files for the extensions you had installed might still be there, and each extension has its own directory containing its ID.

starball
  • 20,030
  • 7
  • 43
  • 238