How can I recover lost/deleted/reset VS Code settings?
Asked Answered
O

4

11

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?

Overvalue answered 11/7, 2021 at 21:50 Comment(0)
R
26

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.

Roundish answered 11/7, 2021 at 21:54 Comment(0)
O
12

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.

Overvalue answered 11/7, 2021 at 21:55 Comment(0)
H
3

Try the other answers first (TL;DR use the Settings Sync: Show Synced Data command in the command palette as documented in the Settings Sync docs on Restoring Data), and then if that doesn't work, read on.


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.


Another thing that might help is using the Developer: Download Settings Sync Activity that was introduced in VS Code 1.83. It will at least give you some troubleshooting info to show the VS Code maintainers if you wish to raise an issue ticket about a possible bug. I wonder if that data also contains the old values of your settings.

Houlihan answered 30/8, 2023 at 22:26 Comment(2)
Explorer: Focus on Timeline View is the one that worked for me. Because after trying to enable Sync the merge wiped the entire content and I cancelled the sync afterwards leaving me with blank settings file.Promotion
Yeah, I didn't have sync enabled to begin with. This worked. Thanks!Sil
D
1

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

Dunedin answered 21/8, 2023 at 19:56 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.