Checkout a branch or file to the current working tree in a Git repo.
git checkout
is used to update files in the current working tree to a specific version in the index or specified branch.
To restore a file to the version in the index:
git checkout -- <filename>
Popular questions
- Checking out a remote branch
- Cannot checkout as files would be overwritten by merge
- Resolving conflicts of a merge
See also
References
$ git checkout --help