branch-base..branch-head
onto the master
branch
Rebase the changes git rebase --onto master branch-base branch-head
B
since it diverged from A
onto the current branch
Cherry-pick the changes in git checkout base-branch
git cherry-pick A..B