Updates were rejected because the remote contains work that you do not have locally

I’m working on a team with a few developers using git on BitBucket. We are all working on a dev branch, not pushing to master until a release. One of the developers committed incorrect code that overwrote my own by accident, and now I am trying to push the correct code back to the repo. … Read more

Mercurial: how to amend the last commit?

I’m looking for a counter-part of git commit –amend in Mercurial, i.e. a way to modify the commit which my working copy is linked to. I’m only interested in the last commit, not an arbitrary earlier commit. The requirements for this amend-procedure are: if possible, it should not require any extensions. It must not require … Read more