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

 

3 answers

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.

 

0 vote

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

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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jun 12, 2018 in Bitbucket

Do you use any Atlassian products for your personal projects?

After spinning my wheels trying to get organized enough to write a book for National Novel Writing Month (NaNoWriMo) I took my affinity for Atlassian products from my work life and decided to tr...

31,471 views 26 12
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you