: Learning GNU Emacs, 3rd Edition

2.6.3 Reverting a Buffer from a File

2.6.3 Reverting a Buffer from a File

If the undo command isn't useful, there's another way to restore a file to an earlier state. If you want to get the file back to the state that is stored on disk, type M-x revert-buffer Enter. Emacs asks the following question:

Revert buffer from file filename? (yes or no)

The filename is the name of your original file. Type yes if you want to restore the file, or no if you've changed your mind. Emacs copies the file stored on disk into the buffer, conveniently forgetting everything that happened since the last time you saved the file. Although this command is called revert-buffer, note that it can revert only buffers associated with files.


: 0.228. /Cache: 3 / 1