Skip to main content
The 2024 Developer Survey results are live! See the results

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

23
  • 2
    what is the difference between HEAD@{1} and HEAD^ ?
    – hugemeow
    Commented Aug 28, 2012 at 6:11
  • 8
    @hugemeow That would be a fine SO question. Meanwhile man git-rev-parse describes this. HEAD@{1} is the previous value of symbolic HEAD in the reflog whereas HEAD^ is the (first) parent revision of the current HEAD. These two need nod be equivalent (e.g. after a rebase, a hard reset, a branch switch and such things). Do read the linked article for reflog. Cheers
    – sehe
    Commented Aug 28, 2012 at 7:34
  • 13
    PowerShell users, escape the brackets with a backtick: git reset HEAD@`{1`} Commented Feb 15, 2013 at 15:33
  • 6
    ss64.com/ps/syntax-esc.html I think you have wanted to type HEAD@`{1`}, or for that matter do what works on POSIX shells too: 'HEAD@{1}'
    – sehe
    Commented Feb 15, 2013 at 15:38
  • 2
    I think it not only reset the pull, but also my commits =(
    – falsarella
    Commented Apr 24, 2015 at 23:41