Ray
Ray

Reputation: 4929

Git: How do I undo a cherry-pick --no-commit that generated conflicts?

I executed a git cherry-pick XXX --no-commit. I believe this just updates the staging area and the working directory and does not commit anything. The problem is that after executing this command I got many conflicts. How do I undo this? I want to go back to the way it was before the command. I ran this on a patch branch. what command do I execute?

Upvotes: 4

Views: 7409

Answers (1)

Romain Valeri
Romain Valeri

Reputation: 21928

git reset --hard HEAD will restore the state of last commit. (Then you'll be able to resume your cherry-picking process, or not, or in a different order.)

Upvotes: 6

Related Questions