PortMan PortMan - 1 year ago 85
Git Question

How to make my workspace match another commit like "hg revert -r [commit] --all"

Without changing which commit I have checked out, how can I set my entire working directory to a different commit?

In mercurial, I would do this with

hg revert -r [commit] --all

Answer Source

Use git checkout with a path; e.g. '.' for the complete actual working directory:

git checkout <commit-id> -- .
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download