# 让单个文件回退到指定的版本
- 进入到文件所在文件目录,或者能找到文件的路径
- 查看文件的修改记录
git log xxx.php | |
commit 6d9bfd8c3f79c09b622615e4fa8ede14edb8dee0 | |
Author: baopeng <baopeng@hisense.com> | |
Date: Thu May 12 20:09:53 2016 +0800 | |
commit 42d79aff06494b5eb10c1c5d6ef210273a8ae5f1 | |
Author: baopeng <baopeng@hisense.com> | |
Date: Wed May 11 16:19:59 2016 +0800 |
- 回退到指定的版本
git reset 42d79aff06494b5eb10c1c5d6ef210273a8ae5f1 xxx.php | |
Unstaged changes after reset: | |
M xxx.php |
- 提交到本地修改
- 提交到远程仓库