Let's say I have an open Pull Request on Github and I pushed a new commit to the branch/PR.
Now I want to just ignore/undo the last commit only.
this is the git log
output:
commit xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Author: John Doe <John Doe@gmail.com>
Date: Wed Oct 19 22:55:39 2022 -0700
last commit
commit yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
Author: John Doe <John Doe@gmail.com>
Date: Mon Sep 26 14:38:21 2022 -0700
some tweks
commit zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
Author: John Doe <John Doe@gmail.com>
Date: Mon Sep 26 11:51:19 2022 -0700
bla bla
I already pushed the last commit
to remote / open PR.
What is the best way to "cancel" ONLY the last commit and leave things exactly how it was before the commit xxxxxxxxxxxxxxxxx
?
Is there a better/cleaner way than:
execute locally git reset HEAD^1
to undo the last commit then push it?