Create git branch, and revert original to upstream state

前端 未结 3 1109
长发绾君心
长发绾君心 2020-12-23 10:12

I recently screwed up my git repo and would like to find out if there is any remedy to it.

My setup is this:

Central repo on github.
Personal repo on         


        
3条回答
  •  天命终不由人
    2020-12-23 10:44

    # Make sure we're on the master branch
    $ git checkout master
    
    # Make a new branch to hold the work I've done
    $ git branch old_master
    
    # Reset my local master back to match origin/master
    $ git reset --hard origin/master
    

    Now you can checkout old_master and use it just like you did your feature branch

提交回复
热议问题