don't worry about rebase. Create a new branch. If X is a sha1 or treeish commit to use, then:
git checkout X -- .
git add -A
git commit -C X
Repeat all commits in the chronological order you want.
An example, when we cancel the order of the last 5, it does:
git checkout -b temp old_branch~5
git checkout old_branch -- .
git add -A
git commit -C old_branch
git checkout old_branch~1 -- .
git add -A
git commit -C old_branch~1
git checkout old_branch~2 -- .
git add -A
git commit -C old_branch~2
git checkout old_branch~3 -- .
git add -A
git commit -C old_branch~3
git checkout old_branch~4 -- .
git add -A
git commit -C old_branch~4
git push . HEAD:old_branch -f
git checkout old_branch
git branch -d temp
git log -5 # to see the new history
hope this helps.
source
share