git还原文件

 

$ git checkout <commit-hash> -- <filename>

在这个命令中, -- 表示参数的结束, <filename> 是要还原的文件名

例子:

git checkout 070a6677af7d7b14b3ea65d4e63f5a249e3645e8 -- config.json

posted @ 2023-10-31 08:10  风别鹤  阅读(26)  评论(0编辑  收藏  举报