Next: Auto Save Prev: Saving Up: Files
Reverting a Buffer
If you have made extensive changes to a file and then change your
mind about them, you can get rid of them by reading in the previous
version of the file. To do this, use `M-x revert-buffer', which
operates on the current buffer. Since this is a very dangerous thing
to do, you must confirm it with `yes'.
`revert-buffer' keeps point at the same distance (measured in
characters) from the beginning of the file. If the file was edited only
slightly, you will be at approximately the same piece of text after
reverting as before. If you have made drastic changes, the same value
of point in the old file may address a totally different piece of text.
Reverting marks the buffer as "not modified" until another change is
Some kinds of buffers whose contents reflect data bases other than
files, such as Dired buffers, can also be reverted. For them,
reverting means recalculating their contents from the appropriate data
base. Buffers created randomly with `C-x b' cannot be reverted;
`revert-buffer' reports an error when asked to do so.
automatically generated by info2www