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

i made a commit and pusheed it, how to undo this particular commit from bitbucket parmanently; so no team member can use it.

Harsh Mathur Sep 21, 2015
 

3 answers

11 votes
Tim Crall Sep 21, 2015

If your remote (BitBucket) allows force-pushing, you can do this:

git reset --hard <last_good_commit_ID>
git push -f

You should NOT do that if anyone has pulled down the bad commit, as it will screw up their ability to push back to the repo.  Also don't do this if there are any good commits after the bad commit that you don't want to lose.

 

Otherwise,

git revert <bad_commit_ID>
git push

will push a commit that reverses the changes made by the bad commit, but it won't remove the bad commit from the repo.  This is better if other people have pulled down the bad commit because they will also pull down the commit that reverts it, but this may not accomplish your goal if you want to delete it from the remote repo as if it was never there.

 

Thanks a LOT!

Afif Fahmi I'm New Here Apr 17, 2019

Thanks. This is exactly what I need.

iKosmik I'm New Here yesterday • edited

Is there terminal in bit bucket ?

Seth 4 hours ago

@iKosmik No, you need to use your local terminal and force push to bitbucket.

1 vote
Jobin Kuruvilla [Go2Group] Community Leader Sep 21, 2015

Try git revert or reset, depending on what you need.

0 votes
Seth Sep 21, 2015

Using normal techniques, you can't. There are surely some advanced commands that might allow you to delete the commit from the repo, but they aren't specific to Bitbucket, so you should probably take your question to a larger Q&A site (stackoverflow, for example) and phrase it as "git" or "mercurial", rather than "bitbucket".

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Bitbucket Pipelines

Building a Bitbucket Pipe as a casual coder

...ipe.sh :  #!/bin/bash source "$(dirname "$0")/common.sh" enable_debug extra_args="" if [[ "${DEBUG}" == "true" ]]; then extra_args="--verbose" fi # mandatory variables R...

3,136 views 1 22
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