Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Abort a git cherry-pick?

You can do the following

git cherry-pick --abort

From the git cherry-pick docs

--abort  

Cancel the operation and return to the pre-sequence state.


I found the answer is git reset --merge - it clears the conflicted cherry-pick attempt.


For me, the only way to reset the failed cherry-pick-attempt was

git reset --hard HEAD

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.

--abort Cancel the operation and return to the pre-sequence state.

use help to see the original doc with more details, $ git help cherry-pick

I would avoid 'git reset --hard HEAD' that is too harsh and you might ended up doing some manual work.