git-回退单个文件 到指定的版本

1.进入到文件所在文件目录,查看文件的修改记录

$ cd ui/css/
$ git log bootstrap-table.css
commit 315752c5a94a6d303ce1678fd8bc541892a09a7c
Author: qiangzhao14 
Date:   Tue Jan 3 11:51:54 2017 +0800
    机构调整
commit 8365bdf18b385ed89cc9a81097c64910a0682777
Author: 张玉利 
Date:   Thu Dec 29 18:21:15 2016 +0800
    样式调整

2.回退到指定的版本

$ git reset 8365bdf18b385ed89cc9a81097c64910a0682777 bootstrap-table.css


3.提交到本地仓库

$ git commit -m 'taoye huitui'


4.更新到工作目录

$ git checkout bootstrap-table.css


5.提交到远程仓库

$ git push origin develop



这样就把指定的文件回退到指定的版本了。


你可能感兴趣的:(Git)