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 do I restore the branch? Is there a way to undo the most recent commit for the whole repository?
Yes, it is possible. By using git reflog find the SHA1 for the commit at the tip of your deleted branch, then just git checkout [sha]. And once you're at that commit, you can just git checkout -b [branchname] to recreate the branch from there.
What work is restored when the deleted branch is recovered? The files which were stashed and saved in the stash index list will be recovered back. Any untracked files will be lost. Also, it is a good idea to always stage and commit your work or stash them.
Here is a solution if you are using TortoiseSVN:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With