Next git-rebase: why and how 4

What for?

Suppose I am making some changes to my topic branch topic

After three commits, I realize I don't have topic checked out

I have master checked out


I can use git-rebase to copy the commits to the right branch

       git rebase topic

Then I put master back where it is supposed to go

        git checkout topic
        git reset --hard master
        git checkout master
        git reset --hard HEAD~5