After doing the git rm --cached command, try adding myfile to the .gitignore file (create one if it does not exist). This should tell git to ignore myfile.
The .gitignore file is versioned, so you'll need to commit it and push it to the remote repository.