5

I was playing around with my VSCode Settings Sync, and accidentally replaced my settings.json file with another one from a fresh install, as a consequence, I lost my entire settings.json configuration.

Is there a way to recover the lost settings.json file?

I checked my backups, however, it seems that I one cannot go back into the /Users/mf/Library/Application Support/Code/User/Sync folder.

starball
  • 20,030
  • 7
  • 43
  • 238
FooBar
  • 5,752
  • 10
  • 44
  • 93
  • why do you think VSC would create a backup of all it does, VSC assumes that you know what you do, if you do something new make a backup yourself, if these where stored on an SSD you might get them back with a file recovery tool – rioV8 Jun 23 '21 at 21:51
  • 1
    I just lost EVERYTHING on my settings because I turned sync on. I can't find any backups anywhere. It's just frustrating, really. I'm almost turning the vscode folder into a git repo and versioning the settings file myself – drigoangelo May 10 '23 at 12:13
  • Does this answer your question? [How to recover VSCode settings deleted?](https://stackoverflow.com/questions/68340146/how-to-recover-vscode-settings-deleted) – starball Aug 27 '23 at 08:24

1 Answers1

6

Yes you can get them back.

They are saved on the hard-drive if your settings are set to their default values.




The universal method (works the same for all systems) is to hit the [F1] key, then type the command below into the input, until you see the option. When you do see the option click on it to open the directory.

Settings Sync: Open Backups Folder


The other option you have is to view the data in VSCode using the following VSCode command from your quick input using the [F1] key followed by the same instructions for the command above.

Settings Sync: Show Synced Data




There should be several saved versions of your settings, unless you have changed your configuration for settings sync in the settings menu, or in your user/workspace settings.json file.


Personally I like to just open backup folders and pullout what I need. If you are like me, and you use Ubuntu then the path below is the path used by VSCode to store backed-up keybindings & Settings.json instances. You can pullout what ever you need from that directory.

~/.config/Code/User/settings.json



If you need to restore the backed up files, you can visit this link, it demonstrates how to return to a previous editor configuration:


RESTORE PREVIOUS VS CODE CONFIGURATION:


JΛYDΞV
  • 8,532
  • 3
  • 51
  • 77
  • unfortunately the "Backups Folder" only contains extensions from yesterday, after the sync was done, i.e. not settings/folders from BEFORE the sync. – FooBar Jun 24 '21 at 10:30
  • Ah. I see. I actually have data from there, before the sync erase happened. But the format is weird. How do I restore this backup? – FooBar Jun 24 '21 at 10:39
  • @FooBar This is the link that explains restoring your saved editor configuration to a previous point: https://code.visualstudio.com/docs/editor/settings-sync#_restoring-data – JΛYDΞV Jun 24 '21 at 10:55
  • i restore my settings from "Settings Sync: Show Synced Data", thanks! – qiz_newbie May 07 '23 at 18:34