I've made a commit,
CM
P1
P2
C1-C2-CM-P1-P2
C1
C2
C1-C2-P1-P2-CM
If you haven't push your branch yet, you can do an interactive rebase:
git rebase -i C2
You can then reorder your commits as P1-P2-CM, and re-apply them on top of C2.
P1-P2-CM