by NickHolt · 10y ago · 0 comments
git branch some-new-branch-name
git reset --hard origin/master
git checkout some-new-branch-name git checkout correct-branch
git cherry-pick wrong-branch
git checkout wrong-branch
git reset --hard HEAD~Also, if you have more than one commit before you noticed you were on the wrong branch, this only grabs the one commit.