remove file from git without deleting local copy code example Example: remove directory from git without deleting #for directory git rm --cached -r myfile