What do these arguments mean in the "git-checkout" command?

Asked

Viewed 120 times

4

I have the following command in Git to recover a file:

git checkout (hash-commit)^  --(caminho-arquivo)

In this command what the ^ and --?

1 answer

7


The ^ indicates that you want the commit a level above this specified. It is the same as ^1, If you wanted 2 levels above would use ^2.

The -- indicates that you will pass a subcommand, an argument of what you will do with the main command.

  • Very well explained. Thank you !

Browser other questions tagged

You are not signed in. Login or sign up in order to post.