git reset HEAD . (note the trailing dot) git stash (save the conflicted merge, just in case) git checkout develop git fetch upstream; git merge upstream/develop git checkout <new-branch>; git rebase develop git stash apply stash@{1}