The concepts are
- Jump to a changeset that is your last stable(good) changeset with command 'update'.
- Use command 'revert' to the last changeset of dirty branch*.
- Commit reverting, this will produce new head.
- Remove old head with command 'strip'** or pull from other repository the new head with command 'pull -r' and delete this repository.
** Strip is an Hg extension.