Git remove file staged for commit from the staging area (Undo a git add)

If you need to remove a file from the list of files about to be committed then “git reset” will undo the git add.

git reset somefile.java

It will only remove it from the staging area, it will not change the contents of the file.