git rebase your current branchgit rebase originremove each of your commits from your branch, saving them as patches (in a directory named ".git/rebase"), update your branch to point at the latest version of origin, then apply each of the saved patches to the new branch