Lesstep
Bitbucket Cloud · Data Center · branches · Checked November 10, 2026

Restore a deleted Bitbucket branch

A branch is only a name for its last commit. To bring a deleted branch back, find the hash of that commit in a clone, make a branch from it and push it to Bitbucket. This is the way Atlassian's knowledge base describes for Bitbucket Cloud and Data Center (How to restore a deleted branch). Copy the clone's folder first, as Atlassian suggests, and don't wait long: Git cleans up commits that nothing points to.

Find the last commit

Try these in order, in the clone where you last had the branch. The examples use the branch feature/one.

To review the branch's pull request once it is back: Pull Request Inbox for Bitbucket, a plugin for JetBrains IDEs, lists the pull requests that wait for your review, with their diffs, in the IDE.

Make the branch again and push it

git checkout -b feature/one 773677e
git push -u origin feature/one

The short hash works in most commands; if one doesn't take it, use the full hash. A pull request that was declined or merged stays as it was: open a new one from the restored branch if it still needs review.

Keep a branch from being deleted

In Bitbucket Cloud, a branch restriction (Repository settings > Branch restrictions) keeps the branch from being deleted unless its rule has Allow deleting this branch checked, which Atlassian presents as a guard against someone deleting the main branch (Use branch permissions). For a source branch deleted by a merge, see whether Close source branch was checked on the pull request.

Bitbucket pull requests in IntelliJ IDEA

Pull Request Inbox for Bitbucket, a plugin by Lesstep for JetBrains IDEs 2024.1 or later, lists the pull requests that wait for your review in an IDE tool window, with their diffs and discussions, and shows next to each which merge checks pass and which block the merge. The review inbox, diffs, discussions and merge checks are free; approving, commenting and merging are Pro, with a 30-day trial. It also works with Bitbucket Data Center (beta).

Get it on JetBrains Marketplace

Bitbucket and Atlassian are trademarks of Atlassian; IntelliJ IDEA is a trademark of JetBrains s.r.o. This page is not affiliated with or endorsed by Atlassian or JetBrains.

More: Bitbucket Cloud branch restrictions · Changes missing from a branch · The source branch was not deleted after the merge · Check out a pull request locally · Bitbucket merge strategies · 日本語