Reset a file to HEAD

git reset-file

  • Revert a file to HEAD or a specific commit.
    Part of `git-extras`.
    More information: <https://github.com/tj/git-extras/blob/master/Commands.md#git-reset-file>.
  • Trick copyright: tl;dr; <https://github.com/tldr-pages/tldr>

git reset-file {{path/to/file}}

click the source code to copy install git reset-file on any operating system with command-not-found.com