views:

102

answers:

6

I accidentally deleted a major folder inside of the Tortoise-SVN Repro Browser. The working folder is unaffected.

What is the recommended way to reverse that?
Do I just Revert back to the previous version? Or do I need to do a Checkout to that previous version into a new folder and delete the old folder?

+1  A: 

You can do a copy from the revision just prior to the deletion to add it back into the repo.

Their isn't a real 'undelete' option in svn.

Dan McGrath
+3  A: 
  1. Update your working copy to the head version
  2. Check out the prior version to a new folder
  3. SVN Copy the deleted folder from the priorVersionFolder to the headVersionFolder
  4. Add in the headVersionFolder
  5. SVN Commit the headVersionFolder
Nick DeVore
This isn't the recommended method. Using copy @REV is as you can track where stuff come from. Just manually copying the files in on the file system trashes the history.
Dan McGrath
If you use "SVN Copy", it will properly record the revision the copy was made from. I just tested this using exactly the above description, and the log in TortoiseSvn now shows that the directory was copied from revision 1 (where it exists).
Lasse V. Karlsen
A: 
  1. Check out the latest version of the repo to a new directory.
  2. Use Tortoise to merge to the version before your deletion.
  3. Check in the results of the merge.

See the Subversion book for more info.

Andrew
A: 

There are other questions similiar to yours here at Stackoverflow. Maybe you could find something useful from the answers there.

Erik Töyrä
+2  A: 

Since you mentioned you are using TortoiseSVN:

Do a TortoiseSVN | Show Log on the working directory. Right click on the checkin where you deleted the folder. Choose Revert changes from this revision.

That will re-create the missing files in your working folder. You can then revert any OTHER changes that were in that revision that you actually want to keep. Once you have your working folder in the state you want it, commit.

I am not sure if this method preserves the history.

Joshua Flanagan
A: 

Have you tried the TortoiseSVN docs?

This is described as Rollback revisions.

What happens is that you rollback the deletion, so the previous version (the one before you did the delete) becomes the new HEAD revision. The deletion will still appear in the log, but it also describes how you can save your embarrassment (though that's more complicated) :)

gbjbaanb