You can use the below command to remove the directory from the git repository but not from the local file system.
git rm -r –cached myFolder