Ammending commit doesn't want to remove (parts of) files
Created originally on Bitbucket by Mojca Miklavec
I often make the mistake of forgetting to uncheck some files before commiting. I realize this after clicking the "commit" button, but before pushing to a public repository and I would like to remove a couple of files from that commit before making the commit public.
The "Ammend" functionality works perfectly when I forget to add some files. I can then just add the missing bits and pieces and click Ammend. But the same doesn't work when I try to remove files. Tortoise just tells me that there's nothing to commit.
I then spent quite some time trying to figure out how to properly do this from the command-line. I didn't find a straightforward way yet. A lazy-man approach for me in git would usually be "git reset HEAD~1" which would undo the last commit without modify the files and then repeat the commit steps themselves again (I would need to retype the). After a lot of searching I figured out the mercurial equivalent being "hg strip --keep ." I also spent quite some time time trying to figure out how to do that in TortoiseHG, but without any success yet. That's a different issue or perhaps a feature request in case it's not yet implemented.
But being able to remove files from the last commit would be super super useful.