How do you remove a file from the staging area in Git?
a)
git resetb)
git deletec)
git removed)
git rm --cachedAnswer:
d)
git rm --cachedExplanation:
The git rm --cached command is used to remove a file from the staging area without deleting it from the working directory. This command only unstages the file, so it will not be included in the next commit, but it remains in the directory.
For example, if you’ve added a file by mistake, you can use git rm --cached filename to unstage it. The file will still exist locally but won’t be committed until it is re-added.
This command is useful when you want to exclude files from a commit or undo a mistaken git add operation without losing the file entirely.