Hi,
We have accidentally deleted a remote branch but we have a pull request of this deleted branch and the parent branch is also deleted. Can we restore this branch somehow?
Regards,
Rohini
Suggestion #1: if you know the commit-id for the branch you want to restore, this usually works (from a reasonably up-to-date clone):
git push origin [commit-id]:refs/heads/[name-of-branch]
Suggestion #2: if "[commit-id]" is not present in the clone, then things get a little trickier, since you'll need to mess around in Bitbucket's back-end area ($BITBUCKET_HOME/shared/data/repositories), and you can potentially break things catastrophically if you're messing around in there.
Note: I assume you're on Bitbucket Server. If you're on Bitbucket Cloud, then suggestion #1 still works, but you'll need to open a support ticket with Atlassian to attempt anything similar to suggestion #2.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.