Skip to content

Instantly share code, notes, and snippets.

@iolloyd
iolloyd / branch_fix.sh
Created December 9, 2016 10:37
Branching from the wrong branch in git
# branch/current <- Branch with commits
# branch/main <- Branch that should have been branched from
# branch/other <- Branch that was actually branched from
git checkout branch/main
git checkout -b branch/correct
git rebase --onto branch/correct branch/other branch/current