Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Restore a deleted branch from pull request


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?




1 comment


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.


Log in or Sign up to comment
Community showcase
Published in Bitbucket

New improvements to user management in Bitbucket Cloud 👥

Hey Community! We’re willing to wager that quite a few of you not only use Bitbucket, but administer it too. Our team is excited to share that we’ll be releasing improvements throughout this month of...

3,810 views 10 16
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you