There may be time when you like to undo a commit. In my situation, i was on the wrong branch when made the commit. To solve problem i try to run mercurial command ‘hg rollback’ that rolls back single commit or pull,however. When run, it returned:
>No rollback information available
Fortunately, i had my changes saved in the patch using shelving. In this post, about alternative if ‘hg rollback’ does do it.
An alternative to rollback there is command ‘hg strip [hashOfChangeset]’. This removes the said changeset including changesets that descend from it.
In order, to use this command you need to enable ‘mq’ extension that is part of mercurial package(version 2.3.1). To enable this extension, update global mercurial configurations -.hgrc file(usually home directory) the ‘extensions’ section as follows:
... [extensions] mq= ...
Afterwards, run the command with the change set you wish to strip (use ‘hg log -l10 will show you last 10 changesets)
>hg strip someChangeSet Useful Links