title: How to undo a push if there are no commits available anymore
body: <p>I have two branches on git - master and main. I wanted to push all my work from the main to the master branch. What I did instead was pushing all my work from the master branch to the main branch. Now all my work from the main branch is gone. I cannot just access a past commit from main because all the commits got replaced from the commits of the master branch.</p>
  <p>How can I revert this step to get my old main branch back?</p>
  <p><strong>Git commands I used for the mistake</strong></p>
  <pre><code>git checkout master   
  git branch main master -f    
  git checkout main  
  git push origin main -f 
  </code></pre>
  <p><strong>What I wanted to do instead (I guess)</strong></p>
  <pre><code>git checkout main   
  git branch master main -f    
  git checkout master  
  git push origin master -f 
  </code></pre>