remove tracked files from repo code example Example: git remove tracked files without deleting git rm --cached -r mydirectory