As the title says I want to remove just a reference to other repository from my main repository without removing the files from that repository. As I can see all commands from git removes the repository files and I do not want to do this.
You should try with:
git submodule deinit {{SUBMODULE_PATH}}
rm -rf .git/modules/{{SUBMODULE_PATH}}