Files
codefever/doc/en-us/git/checkout.md
Carney Wu d3de96487f initial version (#1)
* fix(Useless Code): remove useless code

* feat(Deploy Scripts): add deploy scripts

* fix(Delopy Script): change settings

* fix(Deploy Script): fix ssh-keygen script

* fix(Deploy Script): change env file path

* feat(Deploy Script): add db migration

* fix(Deploy script): change script

* feat(Deploy Script): add sql file to create database

* fix(Deploy Script): add composer support

* fix(Deploy Script): add composer

* fix(Service Script): add http gateway

* fix(Deploy Script): add git path

* fix(Deploy Script): fix setting bugs

* fix(Init Script): get user from config

* fix(Service): adjust run users

* feat(Doc): add doc

* fix(Doc): change docs

* fix(Deploy script): change owner of storage path

* feat: codefever-community documentation system

* fix(Doc): doc details page style

* feat: fix page navigation

* fix(SQL File): fix db file fit MySQL 5.7

* fix(FileTree): empty repository display

* fix: fix helper navigation

* docs(zh-cn essential part):

* fix(Doc Style): change markdown.css

* docs(contribution doc):

* fix: unified page style

* docs(Readme): add readme

* build(Build):

Co-authored-by: cubic <carneywu@pgyer.com>
Co-authored-by: pololi <pololi@pgyer.com>
Co-authored-by: yangchen <chenyang@pgyer.com>
2022-01-19 17:21:59 +08:00

625 B

回退文件到指定版本

回退文件到指定版本

如果需要回退某个文件到指定版本,则需要:

git checkout <commit hash> <file path>

命令执行成功后, 工作目录的文件内容回退到指定版本的文件内容, 同时已保存至暂存区。

还可以指定回退的版本数来进行回退操作,例如:

git checkout master~<num> <file path>

命令执行成功后, 工作目录中的文件内容回退到 master 分支最近的第 <num> + 1 次提交的内容, 并保存至暂存区。

参照: Git 常用命令参考