For this question, you need to undo the effects of
git rm <file>
or
rm <file> followed by git add -A
To restore the file status in the index
git reset -- <file>
To check out a copy from the index
git checkout -- <file>
To undo git add <file>, the first line of the code will meet your needs, assuming you haven't committed yet.