Interactively discard hunks¶
Unstaging hunks¶
With the following command, the staged changes can be unstaged:
git reset --patch
It is the opposite of git add –patch i.e. selectively staging hunks.
Discarding hunks¶
If you want to throw away hunks i.e. completely discard them without leaving any history, use:
git checkout --patch