git rm --cached command in git code example Example 1: git remove cached git rm -r --cached <name-of-dir> Example 2: git rm cached $ git rm --cached filename