4 ms·
One thing that is missing is how to revert your working directory back to a tagged revision. Is that done with checkout?
by kruhft 15y ago
One thing that is missing is how to revert your working directory back to a tagged revision. Is that done with checkout?
- zrail 15y agoMoving between refs is almost always done with checkout git checkout tag-name Tags are just a fancy label pointing to a commit so you can use them anywhere you'd use a sha1 or branch name.
- pixeldude 15y agoI'll add that one to the guide as well. Thanks!
- dave1010uk 15y agoOr, if you don't want to keep untracked files: git reset --hard <commit>
- Aga 15y agoPlease note that this does more then what the parent suggests doing by "git checkout". This destroys untracked changes and resets your current branch-pointer to <commit>, removing all the commit-history that comes after <commit>. (You can still recover them from the database, e.g. with "git reflog")