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