tags:

views:

39

answers:

3

I see a lot about reverting back a revision, but is there a way to specify a file that you want to restore?

Basically, svn up show a bunch of files have been deleted... (D filename) I want to "undelete" those...

+1  A: 

Restoring a deleted file in Subversion is a bit tricky. This is your best bet I think:

svn copy -r 411(revision in which the file existed) http://svn.scm.example.com/repository/trunk/doc/text/file.txt file.txt
Bozhidar Batsov
+2  A: 

Ask svn to revert changes from the revision in which the files of interest were deleted into your working copy, then partially commit changes so that only the files of interest are restored and no other changes are committed.

sharptooth
A: 

Just use the svn merge command to undo commits.

in svn 1.5.X

svn merge -c -RevisionWithTheFileYouWantToUndelete URL/trunk

in svn 1.6.X

svn merge -c -RevisionWithTheFileYouWantToUndelete ^/trunk 

(^/trunk Dependes on your repo structure)

Be careful to prefix the revision with a dash and before doing such a such have no uncommitted changes in your working copy.

Than all files will be reconstructed. No you can use the undo the things you don't like to have

 svn revert file.txt...

You leave those which should be restored and finally just commit that.

khmarbaise