Revert a merged Bitbucket pull request
A merged pull request cannot be undone, but its changes can be reverted. Revert makes a new branch with a commit that undoes the merge, then opens a new pull request from it, so the revert is reviewed like any other change. Bitbucket Cloud and Bitbucket Data Center both have the button, with different limits. Below is how each works, from Atlassian's Merge a pull request (Cloud), Unable to revert pull request in Bitbucket Cloud and How Revert Pull Request works (Data Center).
Bitbucket Cloud
On the merged pull request, select Revert at the top right. In the Revert pull request dialog you can change the Branch name, then select Revert. Bitbucket creates the branch, with one commit that reverses the merged commit, and opens Create a pull request with that branch as the source. Add reviewers and select Create. The branch stays in the repository even if you cancel the pull request.
Revert does not work for a pull request merged with Fast forward or Squash. Bitbucket answers "Unable to revert pull request" and says the revert "would cause conflicts on one or more files", which reads like a conflict; for these two strategies the cause is the strategy itself. A request to support those strategies, BCLOUD-21987 (opened June 2022), was still Gathering Interest with 19 votes on November 2, 2026; an older one for squash alone, BCLOUD-19983, was closed as Won't Fix. Atlassian's workaround is to revert with git (below).
Bitbucket Data Center
Data Center 10.4 (May 2026) added a Revert button to the pull request's overview page. It works for the merge strategies that leave a single commit on the target branch:
- Merge commit (
--no-ff) - Rebase and merge (rebase, then
merge --no-ff) - Squash (
--squash) - Squash, fast-forward only (
--squash --ff-only)
A pull request merged with fast-forward or rebase fast-forward put its commits on the target one by one and is not supported. If later changes touched the same lines, the revert may not apply cleanly; then resolve the conflicts and revert with git. Older Data Center versions have no Revert button at all.
Reverting with git
Make a branch from the target, revert the commit the merge made there, push it and open a pull request from it:
git fetch origin
git switch -c revert-pr-21 origin/main
git revert -m 1 <merge commit> # Merge commit, or Rebase and merge
git revert <squash commit> # Squash
git push -u origin revert-pr-21
A merge commit has two parents, and -m 1 keeps the target branch's side (git revert). For a fast-forward merge, revert the pull request's commits themselves. Atlassian's Cloud article gives the same git revert -m 1 for a merge commit.
Bringing the changes back
After a merge commit is reverted, merging the same branch again does not bring its changes back. The original commits are still in the target branch's history, so git sees them as already merged; only commits added to the branch afterwards come through. Atlassian's Data Center article gives two ways out: revert the revert commit, or cherry-pick or rebase the original commits onto the branch so they get new hashes and merge as new changes. A pull request that was merged with Rebase and merge already had its commits rewritten on the target, so merging again usually works without either.
In IntelliJ IDEA
Pull Request Inbox for Bitbucket, a plugin by Lesstep for JetBrains IDEs 2024.1 or later, lists the Bitbucket Cloud and Bitbucket Data Center pull requests waiting for your review in an IDE tool window. Revert is a button on the Bitbucket page and is not in the plugin. When you revert with git, the IDE's own Git log has Revert Commit (JetBrains: undo changes), and once the branch is pushed the plugin creates the pull request from it with the repository's default reviewers, as Bitbucket's create page does. Creating pull requests is a paid feature with a 30-day free trial; reading stays free.
Get it on JetBrains Marketplace
Bitbucket is a trademark of Atlassian Pty Ltd; IntelliJ IDEA is a trademark of JetBrains s.r.o. This page is not affiliated with or endorsed by Atlassian or JetBrains.
More: merge strategies · decline and reopen · change the destination branch · merge conflicts · 日本語