There\'s git add -p
to stage changes and git checkout -p
to discard changes interactively. How can I unstage changes from index by hunks?
If I am not mistaken, what you want is to unstage hunks interactively? I thought git reset -p
does exactly that. Its prompt message is even exactly like Unstage this hunk?
Also from the manual:
This means that git reset -p is the opposite of git add -p, i.e. you can use it to selectively reset hunks. See the “Interactive Mode” section of git-add(1) to learn how to operate the --patch mode.