How to undo ‘git add’ before commit

Use the following command to undo git add:

git reset <file>