症状
git remote addで誤ったリポジトリを設定してしまい、再度正しいリポジトリを記したコマンドをじっこうするもエラーが表示されてしまいました。
ターミナル
#誤ったリポジトリを設定
git remote add origin https://github.com/ユーザー名/hogeh
#正しいものを再度入力するエラー
git remote add origin https://github.com/ユーザー名/hogehoge
fatal: remote origin already exists.
誤って登録してしまったリポジトリの確認を下記でしました。エラーが出ていたように2度目のコマンドではエラーが出ていたように 設定で上書きはされていないようです。
git -v
origin https://github.com/ユーザー名/hogeh (fetch)
origin https://github.com/ユーザー名/hogeh (push)
```
解決方法
「git remote rm origin」コマンドで登録したリポジトリを削除できました。
ターミナル
git remote rm origin
#登録されているりぽじとりを確認するも何も表示されませんでした(登録が正常に取り消された)
git remote -v
#再度登録しなおしてして確認
git remote add origin https://github.com/ユーザー名/hogehoge
git remote -v
origin https://github.com/ユーザー名/hogehoge (fetch)
origin https://github.com/ユーザー名/hogehoge (push)
参考
git remote add を取り消す方法
https://qiita.com/ngtkk/items/05097d127db6a415a7d8