Command
git rm --cached
Removes a path from the index while leaving the working file. A subsequent commit records deletion from the current snapshot; old commits retain the file. Other checkouts integrating the deletion may remove their copy.
Formal Syntax & Structure
git syntaxgit
git rm [-n] --cached -- pathWorking Example
Example Snippetgit
git rm -n --cached -- generated.txt