How can I do a svn revert <file> from Emacs Version Control?
I've read many parts of the manual, but can't find it.

I would like to do it over a file after opening it with vc-directory C-x v d, but any other way would be helpful.

2 Answers 2


You can use M-x vc-revert.

or use this function:

(defun revert-svn()
    (revert-buffer t t))
(global-set-key (kbd "C-x v u") 'revert-svn)
  • So, it seems that the wiki is wrong. With Emacs 24 I have vc-revert as C-x v u, and vc-revert-buffer with no keybinding. Now, I'm not sure what does the vc-revert-buffer do...
    – nephewtom
    Oct 8, 2015 at 11:42
  • Mmm, it seems it acts over the whole fileset, not just a file. gnu.org/software/emacs/manual/html_node/emacs/VC-Undo.html
    – nephewtom
    Oct 8, 2015 at 11:44
  • vc-revert-buffer is obsolete since 23.1 and the fileset can be just a file.
    – djangoliv
    Oct 8, 2015 at 13:25

As @djangoliv has mentioned, M-x vc-revert works (C-x v u on Emacs 24.5.1).
When doing it over a file on a *vc-dir* buffer (opened by vc-directory command), another buffer with the differences is opened and a prompt message appears in the mini-buffer to confirm it.

Just like this image:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.