How do you unstage a file you added by mistake?
Use git restore --staged file, or the older git reset HEAD file. The file leaves the staging area but your edits stay in the working directory.
Explain it simply
You ran git add . and the staging area now includes a file with a password in it. Unstaging is like taking an item back off the billing counter. You still own it; it just will not be billed.
Both commands copy the file's version from the last commit back into the index. Your working file is untouched. If the file is newly created, it becomes untracked again. This works before committing; after a commit you need amend or reset.
Example
git add .
git status # config.env is staged
git restore --staged config.env
# older equivalent
git reset HEAD config.envWhat to say in the interview
"I run git restore --staged file, or git reset HEAD file on older versions. It removes the file from the index while keeping my changes in the working directory, and it only works before the commit is made."