git checkout branchB git cherry-pick commitid3 commitid1