How can I move HEAD back to a previous location? (Detached head) & Undo commits

In Git, I was trying to do a squash commit by merging in another branch and then resetting HEAD to the previous place via: git reset origin/master But I need to step out of this. How can I move HEAD back to the previous location? I have the SHA-1 fragment (23b6772) of the commit that … Read more

Difference between git checkout –track origin/branch and git checkout -b branch origin/branch

Does anybody know the difference between these two commands to switch and track a remote branch? git checkout -b branch origin/branch git checkout –track origin/branch I think both keep track of the remote branch so I can push my changes to the branch on origin, right? Are there any practical differences? 4 Answers 4