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!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks. This is exactly what I need.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is there terminal in bit bucket ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@ikosmik No, you need to use your local terminal and force push to bitbucket.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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".
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.