This post describes how to retrieve a specific version of a file from Git.
# TREE-ISH could be a commit/tag/branch
# '--' indicates not interpret any more arguments as options
$ git checkout TREE-ISH -- /PATH/TO/FILE
# TREE-ISH could be a commit/tag/branch
# '--' indicates not interpret any more arguments as options
$ git restore -s TREE-ISH -- /PATH/TO/FILE
# Restore working tree and staging area
$ git restore -s TREE-ISH -SW -- /PATH/TO/FILE
Gerrit
Git
Written on
January
30th,
2021
by
Borting