How do I interactively unstage a particular hunk in git?

Solution 1:

Try git reset --patch filename; this should do the opposite of git add --patch, according to the documentation. The short form -p also works for both commands.

Solution 2:

git gui has a decent GUI to interactively stage or unstage hunks or lines. There are prettier/better GUI clients, but git gui is lightweight, built-in, and cross platform (lin, win, mac).

https://git-scm.com/docs/git-gui

Simply right click on a hunk to stage/unstage. For lines, highlight the lines first, then right click.