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