Make a new branch to hold stuff
$ git branch old_master
Send to remote for backup (just incase)
$ git checkout old_master
$ git push origin old_master
Reset local master to the commit before you started modifying stuff
$ git checkout master
$ git reset --hard 037hadh527bn
Merge in changes from upstream master
$ git pull upstream master
Now DELETE master on remote repo
On github this won't work without first going into the admin section for the fork and setting the default branch to something other than master temporarily as they try and protect you from blowing stuff away.
$ git push origin :master
And recreate it
$ git push origin master
On github you should now set the default branch back to master
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…