1

Possible Duplicate:
What’s a simple way to undelete a file in subversion?

I wanted to import a new project called prj1 into the depo. Inside prj1 there is sub1, sub2, ...

cd prj1    
svn import prj1 http://someurl.com/project/branches/

But this was the wrong path and I should have added prj1 at the end of the above line, so I intended to remove the sub-projects in prj1 and I intended to do:

svn remove http://someurl.com/project/branches/sub1

But I mistakenly did:

svn remove http://someurl.com/project/branches

As a result branches is gone. Inside branches, in parallel to prj1, there are some other projects that I don't have local copy of (haven't checked them out). I was wondering if there is any way to undo the accidental svn remove of branches and bring it back to the depo.

EDIT:

As suggested by Lekensteyn, Lazy Badger, and https://stackoverflow.com/a/3128696/1383356, I solved the problem by checking out the latest version (102), and rolled back to version 100 (which was before import) using svn merge. Here are the details:

svn co http://someurl.com/project
cd project
svn merge -r 102:100 http://someurl.com/project
svn commit -m "Rolling back to the old days of r100 :)"
Community
  • 1
  • 1
Ari
  • 7,251
  • 11
  • 40
  • 70
  • @Lekensteyn: That question seems to be about undoing the removal of a file from your local directory. My question is about removing a folder from the depo without having a local copy of other projects. The SVN documentation here distinguishes between the two: http://svnbook.red-bean.com/en/1.6/svn.ref.svn.c.delete.html – Ari Dec 13 '12 at 17:18
  • I cannot directly think of a SVN command that does that on the local side, but if you have server-side access, http://stackoverflow.com/q/402159/427545 might be of help. – Lekensteyn Dec 13 '12 at 17:27
  • I don't have server-side access – Ari Dec 13 '12 at 17:59
  • Any reason why you cannot checkout /project and use `svn merge` to get back to the previous version? See the linked question. – Lekensteyn Dec 13 '12 at 18:07

1 Answers1

1

Your import and remove are separate revisions in repository (check it with svn log)

Undoing of any commit in SVN is a job of reverse-merge: you have to know revision ID of commit with remove, checkout affected path (http://someurl.com/project/ - yes, may be giant checkout, but it's your troubles), backmerge bad revision and commit undoing revision into repo

Another way is checkout http://someurl.com/project/branches/ at the latest revision, when it exist (use PEG-syntax), branch it, update to HEAD, merge branch (restoring tree really), check results in WC, commit

Lazy Badger
  • 94,711
  • 9
  • 78
  • 110