I have got changes in my staging area, and others not staged yet (some files have changes both in and out the staging area). I would like to invert the content of the st
Here’s how I do it:
It can be typed out manually pretty fast, especially if you use Vim for commit messages:
git commit -m tmp1
git add . # optionally with `git add -u` if there are deletions
git commit -m tmp2
git rebase -i HEAD~2 # swap the order of the commits; `ddp:wq` in vi
git reset HEAD~1
git reset HEAD~1 --soft