Is there a way to convert a single commit (e.g. tip changeset in my local repository) to uncommitted changes in working directory?
I know that hg strip removes specified changeset(s) and backs it/them up, but does it convert those changesets to uncommited changes in working directory?
EDIT :
Concerning usage of hg rollback.
What if I have uncommitted changes before I want to do hg rollback? Do I have to commit those first? What about last several commits? Does sequential hg rollback stack up changes from those commits to existing uncommitted changes?
If the commit is the last commit and you have not updated anywhere, then you can use
hg rollback. Please readhg help rollback— is it a potentially destructive command.What it does:
hg rollbackwill roll back the last transaction in your repository. Every time youhg commit,hg pull,hg unbundle, etc, you create a new transaction. When everything is stored safely, Mercurial closes the transaction. If something goes wrong in the middle of the transaction, Mercurial can recover (seehg recover). You can also manually roll back the last transaction withhg rollback. Seehg rollback --dry-runfor a preview of what the command will do.The rollback command wont touch your working copy. This means that files that showed up as modified before will appear modified again. So it’s easy to do
Ups, typo in the commit message! Let’s fix that:
(Use
hg commit --amendinstead with Mercurial 2.2 and later.)The last commit message is also saved in
.hg/last-message.txtso you can recover it from there if you don’t have it in your shell history.Rollback doesn’t touch the working copy. This means that any additional changes in the working copy will appear together with the changes from the changeset. It’s as if you didn’t type hg commit at all.
No, you only have one level of rollback since we only track the last transaction.