4 August 2025

How to remove a file from a Git commit without deleting it

by


Untrack the file from Git

Use git rm --cached to stop tracking the file without deleting it:

git rm --cached a.zip
git rm --cached assets/.7z
tags: git