I have two working copies of a Subversion repository, one of the trunk, and one of a branch I created.
I accidentally deleted the branch in a repository browser. How
Alternatively, if it was a single commit that deleted the branch:
Revert the commit and then commit
svn merge -c -REV .
svn commit -m "Reverting deletion of branch XYZ"
I ran into the same problem and solved it this way in SmartSVN (Enterprise 6.0.2):
Assuming your last revision was 108:
svn merge --revision 108:107
svn diff
svn commit -m "Reverted revision 108"
You can also add your source URL to the merge:
svn merge --revision 108:107 http://svn/repo/
Elsewhere on Stack Overflow: Undoing a commit in TortoiseSVN
Use:
svn cp [path to deleted branch]@[revision before delete] [new path]
For example:
svn cp svn://myrepo.com/svn/branches/2.0.5@1993 \
svn://myrepo.com/svn/branches/2.0.5_restored
Where 1993 is the revision before the delete...
Here is some good documentation...
There must be some way of escaping the @
symbol in the username...
Here is a solution if you are using TortoiseSVN:
This worked for me,
svn cp --username your_user_name https://path_to_your_repo/branches/deleted_branch_name@last_revision_before_deletion https://path_to_your_repo/branches/new_name_for_branch