Wow, I have been using git for ages but I did not know about this. I was relying on magit (for Emacs) and git-cola.
In d u, you can “s” on a file or hunk and it’ll stage just that. And if you select lines (c-spc?) it’ll stage just those lines.
To unstage, go to d s and use “u” the same way.
The massive advantage aside from line-wise staging is that you don’t need to stage linearly.
git checkout -p -- .Git rebase -i HEAD~[number of commits]