how to delete git cache code example Example 1: git clean cache $ git rm -r --cached . Example 2: git rm cached $ git rm --cached filename