I have made 2 git commit
$ git log
commit 9613e1e84b42aeef645977272d310250339cf0e0
commit 01f8699be310f9a56a40835b48a922a879bba24f
Each of them touches DIFFERENT FILES. And I have NOT done a push.
But I would like to amend the commit 01f8699be310f9a56a40835b48a922a879bba24f (not the top one). How can I do it?
I know i can use 'git commit --amend' for the amending the top commit. But not the second one.
How can I fix it?
Thank you.
Use an interactive rebase. git rebase -i HEAD~2 will rebase the last two. You get presented with a list in your editor and can choose to edit just one or more.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With