VS Code tips — The Revert File command

preview_player
Показать описание
Today's VS Code command: Revert File

Revert the current file back to its last saved state.

Useful for discarding changes or making sure the file content in VS Code matches the file content on disk.
Рекомендации по теме
Комментарии
Автор

you are life saver bro, i litreally was on the verge of crying when i undo all the changes and wasnt able to redo, thank you very much brother/sister!!

mcyhctk
Автор

The "File:Revert File" is also handy when I have a *large* text file open in the editor and a process has changed that file. VS Code doesn't "refresh" the large file right away, but the revert command reopens the file with the latest changes from disk.

BrianBlaylock
Автор

doesn't work on my setup though. the command doesn't seem to do anything

lucas.n
Автор

Just tried it, doesn't work neither from the Vscode command palette or from File -> Revert File option. Tried it with freshly modified file AND with an older file that had a bunch of uncommitted changes I wanted to revert. The option unfortunatelly does absolutelly nothing Vscode version 1.67.2

bzlom
Автор

does this work for an already commited file?

MAGG
Автор

It's useless. I save constantly because that's what I've been taught to do by nearly every person ever.

JoeKnouse