To remove files from the Git staging area, use the following command:
git reset
This will unstage the file but keep its changes in the working directory. If you want to unstage all files, use:
git reset
To discard changes to a file and remove it from both the staging area and working directory, use:
git checkout —
This will revert the file to the state of the last commit.