LinuxCommandLibrary

git-reset-file

Revert a file to HEAD or a specific commit.

TLDR

Reset a file to HEAD

$ git reset-file [path/to/file]
copy


Reset a file to a specific commit
$ git reset-file [path/to/file] [commit_hash]
copy

SYNOPSIS

git-reset-file [<filename>] commit-hash

DESCRIPTION

Reset one file to HEAD or certain commit-hash

OPTIONS

<filename>

The name of the file to reset.

<commit-hash>

(Optional) Hash of commit to reset the file to. Defaults to HEAD.

EXAMPLES

Reset one file to HEAD

$ git reset-file .htaccess

or reset one file to certain commit

$ git reset-file .htaccess dc82b19

REPORTING BUGS

<https://github.com/tj/git-extras/issues>

SEE ALSO

<https://github.com/tj/git-extras>

AUTHOR

Written by Sasha Khamkov <sanusart@gmail.com>

Copied to clipboard