Remove git submodule created by mistake
- Make sure that the sub-directory/sub-module doesn't have .git directory. If it does, delete the .git directory inside the sub-directory/sub-module
rm -rf [sub-module]/.git
- Clear the git cache
git rm --cached [sub-module]