Remove Files From Staging Before Committing

Remove Files From Staging Before Committing

Say you have added main.js to the staging area but later you realised that you don't want to commit it.

You have two ways to achieve it.

The old way

git reset HEAD main.js

The new way

git restore --staged main.js