Lesstep
Bitbucket Cloud · lost commits · Checked November 10, 2026

Bitbucket: changes missing from a branch

Atlassian's knowledge base describes how a commit can vanish from a Bitbucket Cloud branch: one person pushes commit X; another, whose clone has not fetched X, commits on the older version and pushes with force. The branch now ends in the second person's commit, and X is no longer part of it (How previously introduced changes can go missing from a branch). Without force, Git would have refused that push with ! [rejected] ... (fetch first).

Confirm it

To start from what is on Bitbucket: Pull Request Inbox for Bitbucket, a plugin for JetBrains IDEs, fetches before it checks out a pull request's branch, and merges the destination branch in the IDE when there are conflicts, with no force push.

Get the commit back

The commit is usually still in a clone:

Put it back on top of the branch as it is now, with a normal push:

git fetch
git checkout -b restore-x origin/feature/one
git cherry-pick <commit X>
git push origin restore-x:feature/one

Or push restore-x as its own branch and open a pull request for it. If no clone has X, the ways to find a hash in restoring a deleted branch can help.

Stop it happening

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. Its Checkout button fetches from Bitbucket before it switches to the pull request's branch, and a branch new to your clone starts from Bitbucket's version. When a pull request has conflicts, Resolve in the IDE fetches, checks out the source branch and merges the destination branch into it, so you resolve them in the IDE's merge dialog and push a merge commit, not a rewritten history. Both are free, as are the review inbox, diffs, discussions and merge checks; creating, 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: Restore a deleted branch · A pull request merged by itself · "pre-receive hook declined" · Merge conflicts · 日本語