Question: I am currently using TortoiseHg (Mercurial) and accidentally committed an incorrect commit message. How do I go about editing this commit message in the repository?

Answer: 
**Update:** Mercurial has added `--amend` which should be [the preferred option now](https://stackoverflow.com/q/8182858/84378).

---

You can rollback the last commit (but only the last one) with `hg rollback` and then reapply it.

**Important**: this **permanently removes the latest commit** (or pull). So if you've done a `hg update` that commit is no longer in your working directory then it's gone forever. *So make a copy first.*

Other than that, you cannot change the repository's history (including commit messages), because everything in there is check-summed. The only thing you could do is prune the history after a given changeset, and then recreate it accordingly.

None of this will work if you have already published your changes (unless you can get hold of all copies), and you also cannot "rewrite history" that include GPG-signed commits (by other people).
I did it this way. Firstly, don't push your changes or you are out of luck. Grab and install the [collapse](http://mercurial.selenic.com/wiki/CollapseExtension) extension. Commit another dummy changeset. Then use collapse to combine the previous two changesets into one. It will prompt you for a new commit message, giving you the messages that you already have as a starting point. You have effectively changed your original commit message.