How do I git rm a file without deleting it from disk? [duplicate] September 21, 2022 by Tarik git rm --cached file should do what you want. You can read more details at git help rm