config.php to a safe place, delete the repos, clone the correct repo, move the
config.php into the newly cloned repo directory. Visit the web page and update the config as instructed if any required settings are missing (probably not if you're coming from 15.x).
If you get permissions errors, fix those.
e: It technically is possible to simply change the repo's origin setting and pull in the latest changes, but given what you've posted so far I'd suggest against that because you have been using an incorrect origin for awhile and there's potential for things to break if you're not familiar with git, etc.