[git系列]-備忘錄

如何查看一個已被刪除文件的歷史git

git log --follow -- [filepath]ui

 

commit b9277b..........
Author: xxxx <xxx@yyy.com>
Date: Mon Oct 28 15:51:59 2013 +0800spa

build目錄更新rest

commit 831bac......
Author:  xxxx <xxx@yyy.com>
Date: Fri Oct 25 11:10:07 2013 +0800get

marketId addit

commit 1c493....
Author:  xxxx <xxx@yyy.com>
Date: Fri Oct 18 10:40:43 2013 +0800io

若是想恢復這個文件的話file

git checkout b9277b [filepath]問答

若是要查看全部庫的文件刪除記錄stackoverflow

git log --diff-filter=D --summary

更多恢復和查看操做能夠看看stackoverflow的這個經典問答

http://stackoverflow.com/questions/953481/restore-a-deleted-file-in-a-git-repo

相關文章
相關標籤/搜索