Move a Commit that was Committed on the Wrong Branch

Chris Achard
InstructorChris Achard

Share this video with your friends

Send Tweet

We'll do some work and commit it - but then realize it was on the wrong branch!

To move a commit from one branch to another, we'll first git cherry-pick the commit we want, and then use git reset to remove the commit from the master branch.

Then we'll be able to manually delete the changes that we don't want on the master branch.