On a local repo, I've just executed git cherry-pick SHA
without any conflicts or problems. I then realized I didn't want to do what I just did. I have not pushed this anywhere.
How can I remove just this cherry pick?
I'd like to know if there's a way to do this:
Preferably with one command for both cases if possible.
Try also with '--quit' option, which allows you to abort the current operation and further clear the sequencer state. --quit Forget about the current operation in progress. Can be used to clear the sequencer state after a failed cherry-pick or revert.
To change the commit message when cherry-picking, use “git cherry-pick” with the “-e” option. As illustrated in this example, your default editor will open and it will let you change the commit message.
A cherry-pick is basically a commit, so if you want to undo it, you just undo the commit.
when I have other local changes
Stash your current changes so you can reapply them after resetting the commit.
$ git stash
$ git reset --hard HEAD^
$ git stash pop # or `git stash apply`, if you want to keep the changeset in the stash
when I have no other local changes
$ git reset --hard HEAD^
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