git 撤回上一次的commit

若是不當心 弄錯了 git add後 , 又 git commit 了。 先使用git

1.git log 查看節點 ,會出現下面這樣的文字:

commit xxxxxxxxxxxxxxxxxxxxxxxxxx 
Merge: 
Author: 
Date:

2.查找到本身想回滾到的某一個commit的狀態,執行下面的語句:

git reset commit_id

其中,commit_id對應上面git log查出的commit後面的內容。code

相關文章
相關標籤/搜索