How to interactive unstage with GIT cli

Asanka Abeyweera
Aug 8, 2017 · 1 min read

Every one of have used the git add -i to interactively stage code hunks. But what if we accidentally stage a code hunk that we don’t want to stage. One thing we can do is unstage all changes using `git reset HEAD <file>…` git reset HEAD <file>... and stage the changes again. But wait there is a cool way to do that.

git reset -p

This command will do the inverse of what git add -i does. That is unstaging the code hunks one by one.