7

I know how to revert to a specific revision of a folder using these instructions:

http://aralbalkan.com/1381

However, I deleted the entire folder and want to get that folder back without reverting the rest of the repository.

I tried recreating the folder and then merging the changes back, but svn knows my trick and realizes it is a new folder.

How should I do this?

3 Answers 3

22

The easiest way is probably to svn copy the tree you want, from the revision where it last existed:

svn copy src@rev dest

See the Subversion Book for details.

2
  • Does that copy the revision history as well? I mean can I browse the history of files in the copied folder? Commented Aug 31, 2009 at 22:02
  • Yes - 'svn copy' copies with history.
    – Avi
    Commented Sep 1, 2009 at 6:42
0

You could check out a new working copy, and then do an export of the folder you're interested in. Once you've exported the folder, it won't have subversion metadata in it. Then you can put the folder into the working copy that it was deleted from.

Best of luck.

0

If you have committed the changes after recreating the folder it is possible that you have the same problem I had:

I lost my history for the files. Then I svn deleted the folder again, and when doing a

svn cp ^/path/to/directory@revisionNumber /path/to/directory 

I received this error:

svn: path "htttp://.../path/to/directory" not found for revision "revisionNumber".

In that case you can use an auxiliary folder (~/tmp/) to do an

cd ~/tmp; svn co -r revisionNumber /path/to/directory 

It will create the ~/tmp/directory/ folder with all the files it contained. suppose that the place where you deleted directory was /location/of/my/trunk/path/to/

and then issue an

 cd location/of/my/trunk/path/; svn copy ~/tmp/directory/ to/

from that path to the path it should be in your tree.

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.