Since git is case sensitive, but the OS is not, git thinks the path is wrong when it actually exists with different caps.
A programmatic way to fix this can be deleting the conflicting path from the OS and then doing a git reset --hard HEAD or checkout the directory from the HEAD.