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

来源:互联网 发布:vnc mac 连windows 编辑:程序博客网 时间:2024/05/21 01:30

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

$ cd ui/css/$ git log bootstrap-table.csscommit 315752c5a94a6d303ce1678fd8bc541892a09a7cAuthor: qiangzhao14 <qiangzhao14@creditease.cn>Date:   Tue Jan 3 11:51:54 2017 +0800    机构调整commit 8365bdf18b385ed89cc9a81097c64910a0682777Author: 张玉利 <yulizhang@creditease.cn>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



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


0 0