Search code examples
visual-studio-codeautosave

VS Code auto-save file history / undo


The auto-save feature of vscode is quite handy, but can be a bit of a trouble some times.

And it will be very usefull if there's a way to see previous versions of the file auto-saved

does vs code have such a feature?


Solution

  • Use the Local History extention.

    A visual source code plugin for maintaining local history of files.

    Every time you modify a file, a copy of the old contents is kept in the local history. At any time, you can compare a file with any older version from the history. It can help you out when you change or delete a file by accident. The history can also help you out when your workspace has a catastrophic problem. Each file revision is stored in a separate file inside the .history folder of your workspace directory (you can also configure another location, see local-history.path). e.g., .history/foo/bar/myFile_20151212205930.ts