next up previous contents
Next: Removing local changes Up: Basic Operations Previous: Copying, moving and deleting   Contents

Reverting a deleted file

Since the history information for a file is never deleted even if the very file is deleted it is possible to restore it. The first step is to find the revision in which it is deleted. This can be done by inspecting the output of svn log:

$ svn log --verbose | grep doc
. . .
--
r6 | usertwo | 2007-02-05 09:22:27 +0200 (Mon, 05 Feb 2007) | 1 line
Changed paths:
   D /helloworld/trunk/doc
. . .

The directory in question is deleted in revision 7. We can restore it in the following way:

$ svn copy -r7 https://localhost/svn/repo1/helloworld/trunk/doc doc
Checked out revision 7.
A         doc
$ svn status
A  +   doc

And we finish the restore by commiting the directory



Ivan Ivanov 2008-04-21