benjamincharity
9/14/2016 - 11:32 AM

Move accidental commits from master to new branch

Move accidental commits from master to new branch

# save everything to a new branch
git branch newbranch

# Reset master to before the new commits were added
# (Warning: You *will* lose uncommitted work)
git reset --hard HEAD~3 # Go back 3 commits.

# Checkout your new branch to see the commits
git checkout newbranch