The latest commit gone after hard reset

I commited my changes and didn’t push them to the server. Then I did hard reset to one of my previous commits and my latest commit gone. Does it mean commits which weren’t pushed to server gone after hard reset?

Is it possible to recover my latest commit?

  • Decoding git objects / “Block length does not match with its complement” error
  • jenkins Wipe out repository and force clone vs Clean before checkout
  • How to disable sparse checkout after enabled?
  • GIT + cocos2d-x: What files can I add to gitignore?
  • Git workflow - changing branch and slow recompiles
  • Git workflow issue. Remove a merged branch from another branch
  • How can I put a database under git (version control)?
  • git ls-files with date?
  • What is the fastest way to clone a git repository over a fast network connection?
  • git squash and preserve last commit's timestamp
  • Multiple projects in one git repo?
  • Github: Push additional commit to pull request
  • One Solution collect form web for “The latest commit gone after hard reset”

    Yes, but not immediately.
    Reflog entries will expire in time and the contents will disappear on garbage collection.

    You can still get them back from the reflog:

    git reflog

    and reset to them/checkout:

    git reset HEAD@{1}

    or, e.g. checking it out to a rescue branch:

    git checkout -b rescue HEAD@{1}
    Git Baby is a git and github fan, let's start git clone.