需求是有个文件需要退回到某个指定版本的状态,直接上命令
查看帮助说明:
git checkout -h
$ git checkout -h
usage: git checkout []
or: git checkout [] [] -- ...
-q, --quiet suppress progress reporting
-b create and checkout a new branch
-B create/reset and checkout a branch
-l create reflog for new branch
--detach detach HEAD at named commit
-t, --track set upstream info for new branch
--orphan
new unparented branch
-2, --ours checkout our version for unmerged files
-3, --theirs checkout their version for unmerged files
-f, --force force checkout (throw away local modifications)
-m, --merge perform a 3-way merge with the new branch
--overwrite-ignore update ignored files (default)
--conflict