13 lines
342 B
Markdown
13 lines
342 B
Markdown
# git reset-file
|
||
|
||
> 将文件还原为HEAD或某个提交。
|
||
> 这是`git-extras`的一部分。
|
||
> 更多信息:<https://github.com/tj/git-extras/blob/master/Commands.md#git-reset-file>。
|
||
|
||
- 将文件重置为HEAD:
|
||
|
||
`git reset-file {{path/to/file}}`
|
||
|
||
- 将文件重置为特定提交:
|
||
|
||
`git reset-file {{path/to/file}} {{commit_hash}}` |