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

Why are commits from my source branch still found on destination branch after using "revert" button?

My colleague accidentally merged a pull request into master that was not ready, then used the revert feature on bitbucket to undo the merge. The problem we have now is that the commits from the source branch are still present on the master branch (although they are ignored and don't effect the code), and it means that for any future pull requests or merges from that source the commits are effectively ignored. How do we get around this?

1 answer

1 accepted

0 votes
Answer accepted

Hey @matgb ,

Just to help clarify, did this happen in Bitbucket Server or over in Bitbucket Cloud (bitbucket,org)?

It looks like this was submitted under Server, but the functionality of a pull request having a 'revert' button doesn't appear to be something that's been developed yet for Bitbucket Server.

With that said - my wheelhouse is in Bitbucket Server and how it ticks, but going off of the information on our Bitbucket Cloud PR merge page, it looks like the intent behind reverting isn't so much to remove commits (and thus git history) as much as it is to provide a convenient means of recovering the code itself to the state it was in before the PR was merged. 

Having a revert outright remove the commits would involve rewriting git history, and could potentially be very destructive depending on the intent of the user attempting to revert the PR. 

Hopefully this helps!


Evan Slaughter

Hey @Evan Slaughter thanks so much for the reply!

Apologies for the confusion regarding the cloud vs server - I definitely should have selected cloud.

Thank you for the clarification around the revert feature. I was interpreting it as more of an 'undo' but that really wouldn't make sense based on the effect it would have on git history. I found a work around by squashing commits on my branch then resubmitting a PR. Works for my use case.

Thanks again!


Suggest an answer

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

Powering DevOps with Bitbucket Server & Data Center

Hi everyone, The Cloud team recently announced 12 new DevOps features that help developers ship better code, faster   ! While we’re all excited about the new improvements to Bitbucket ...

1,886 views 0 7
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