git remove changes from the staged file code example
Example 1: how to remove all files from staging area git
git rm --cached -r .
Example 2: git file reset to head
git checkout HEAD -- my-file.txt
git rm --cached -r .
git checkout HEAD -- my-file.txt