git rm
git rm [--cached] <file>
Risk: Careful
What it does
Deletes a file and tells Git.
When to use it
When a file should leave the project.
Example
$ git rm old.htmlDelete it and stage the delete.
$ git rm --cached secret.txtStop tracking it, but keep the file.
Learn it in: Remove and rename · Official docs