stackoverflow
stackoverflow

Reputation: 1587

VS CODE - disable UNDO command after file was closed

If I'm making some files changes then close it and then reopen it, I will be able to undo those changes. How can I disable this behaviour that only changes made in the current open session can be reverted?

PS: this behaviour was not present for older versions of VS code.

Upvotes: 10

Views: 1965

Answers (3)

Jitendra Kumar
Jitendra Kumar

Reputation: 2211

We can achieve this using the following steps:

  1. Open Setting
  2. Type undo in the search box
  3. Uncheck the checkbox of Restore Undo Stack

You can follow the screenshot:

enter image description here

Upvotes: 1

Abhi
Abhi

Reputation: 480

  • Open VS code
  • Click on manage {bottom-left}
  • Click settings
  • Search undo
  • Uncheck restore undo stack

Upvotes: -1

Mark
Mark

Reputation: 180611

See v1.45 Release Notes:

Disable persistent Undo

Last milestone, changed the Undo/Redo stack to be persisted when you close a file and reopen it. Not everyone wanted this new feature, so there is now a setting, files.restoreUndoStack, to disable persistent Undo.

[Additional info: see v1.46 release notes - you can undo even in files that were closed and remain closed.]

Upvotes: 15

Related Questions