Soft reset already committed file

It often happens that you add to staging all files in the working area with git add . (or gaa with a handy alias), while you wanted to add all but one. You don’t have to soft reset all files and repeat the process:

git reset HEAD^
git reset HEAD -- vim/
git commit -m 'Update dotfiles'
git add vim/ 
git commit -m 'Update vim config'

What you need is:

git checkout HEAD~1 -- vim/vimrc.symlink
git commit -m 'Update vim config'

Of course you can replace HEAD~1 with any valid commit hash.

This protip has been written in 518 seconds