今天发现master的代码写的不对,不想重写,想直接回退到之前一个版本,然后再把这个版本设置为master,弄了好久,终于弄好了。
首选:
</pre><p><pre name="code" class="html">#create a branch
git branch ttt
#step into the branch
git checkout ttt
#back to some commit
git reset --hard HEAD^^
#push new branch into remote reposity
git add .
git commit -m "init new branch"
git push origin ttt
#in the ttt branch
git merge -s ours master
git checkout master
git merge ttt
git add .
git commit -m "init new branch"
git push origin master
#done