title: Undo "git remote rm origin"
body: <p>I encountered this error when doing a <code>git push</code>: </p>
  
  <pre><code>fatal: could not read Username for 'https://usts.visualstudio.com': No such file or directory
  </code></pre>
  
  <p>Looks like I have hit a bug in git 1.8.5 as mentioned here: <a href="https://stackoverflow.com/a/20884273/45603">https://stackoverflow.com/a/20884273/45603</a></p>
  
  <p>Google led me to this post: <a href="https://stackoverflow.com/a/20871910/45603">https://stackoverflow.com/a/20871910/45603</a></p>
  
  <p>So, I ran <code>git remote rm origin</code> followed by <code>git remote add origin 'git@github.com:username/repo.git'</code></p>
  
  <p>Now I get the following message whenever I do a <code>git push</code>:</p>
  
  <pre><code>fatal: The current branch master has no upstream branch.
  To push the current branch and set the remote as upstream, use
  
      git push --set-upstream origin master
  </code></pre>
  
  <p>I would like to undo the <code>git remote rm origin</code> and rollback to git 1.8.4.</p>
  
  <p>How do I undo <code>git remote rm origin</code>?</p>
  
  <p><strong>Edit:</strong> Running <code>git push --set-upstream origin master</code> (as advised by git) gives me the following error:</p>
  
  <pre><code>ssh: connect to host usts.visualstudio.com port 22: Bad file number
  fatal: Could not read from remote repository.
  
  Please make sure you have the correct access rights
  and the repository exists.
  </code></pre>