> For the complete documentation index, see [llms.txt](https://wiki.owain.codes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wiki.owain.codes/git/command-line/remove-files-from-git-index.md).

# Remove files from Git Index

```
git rm -r --cached ./bin
```

`git rm -r --cached` **removes files from the Git index (the staging area) but leaves them on your filesystem**.

Think of it as: **“Stop tracking these files, but don’t delete them from disk.”**

Breaking it down:

* `rm` → remove
* `-r` → recursively (folders too)
* `--cached` → remove *only* from the index, not from your working directory

So after running it, the files still exist locally, but Git treats them as untracked.
