I have been working on a git project with a remote on Github. It contains several submodules.
When creating a submodule, my git client (Sourcetree) created a folder with an invisible character, which has been wreaking havoc. The folder has been pushed to Github, and I can't find a way to revert.
The submodule folder looks like it's named "cours-divers", but is displayed in Sourcetree as "cours020-divers", and shown as "cours?-divers" in Terminal.
Also, Sourcetree isn't able anymore to display the list of submodules.
What I attempted, after reading through related threads:
fatal: pathspec 'cours020-divers' did not match any files
git reset --hard [revision]
git checkout [revision] .
Finally, after some more trial and error, I found that this thread provides the answer: Resetting remote to a certain commit
git reset --hard <commit-hash> git push -f origin master
Doing this does effectively push the project back in time, and gets rid of any reference of the offending file.