再一次開發(fā)過程中, 出現(xiàn)了:
already to update!
仔細(xì)一看, 并沒有在master分支上開發(fā)!!
解決辦法
git reflog 找到需要恢復(fù)的commit ,記下前面的commit id
git branch temp 312f7d7 新建一個(gè)名字叫temp的分支,用這個(gè)分支代替之前的臨時(shí)分支并且擁有想要恢復(fù)的commit, 312f7d7為要恢復(fù)的commit id
git push origin temp推送到倉庫
git checkout master切換到主分支
git merge temp 將temp合并到master
保險(xiǎn)起見,先git push origin master 推送到倉庫
查看是否更新,若更新則git branch -d temp刪除該分支