Files
tldr/pages.zh/common/git-reset-file.md

13 lines
342 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 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}}`