Sometimes when you commit something nasty, you need to rewrite it. Or you may need to split commit into parts. Or whatever.
Use case: You want to remove some files that you added with your commit.
Find the commit
Let it be
Remove files that you don’t want in the commit.
Replace pick with edit and save file.
Then you need to unstage files in the commit:
now all files are in state before that commit, and you can add/remove/stage them.
windows file changes:
or if this is a new file you can just delete it
also you can split this commit into several commits.
Change commit message
Now you probably want to change commit message:
Enjoy you splitted/amended commit.