I\'m currently working on a branch and want some commits to merge into other branches:
a-b-c-d-e-f-g (branchA) / --o-x-x-x-x-x-x-x-x-x-x (master) \
git rebase -i HEAD~3
Where 3 is the number of commits that need reordering (source).
3
This will open vi, listing commits from oldest (top) to newest (bottom). Now reorder the lines, save, and exit the editor.
ddp will move current line down ddkP will move current line up (source)
ddp
ddkP