Recovering from git reset –hard

I did (on master)

git branch mybranch 

and then (still on master)

  • How would you put an AppleScript script under version control?
  • How should I proceed building an application after cloning a boilerplate?
  • VS 2015 RC: Git integration crashed
  • Change colour for “git reflog”
  • How to add specific files in git by their number in git status?
  • Xcode Source Control Git
  • git reset --hard "commitid"

    Now it seems I lost the commits after “commitid”. Really? I lost it?

    Is there anyway to recover?

  • How does Git's concept of the Index improve or change your workflow?
  • Git: delete a single remote revision
  • Push a merge conflicted branch
  • Git: Preventing Commit During a Rebase
  • How do I reset my repository to a certain release and apply all my changes from that point on?
  • `git stash --patch` doesn't accept 'enter'
  • 3 Solutions collect form web for “Recovering from git reset –hard”

    Simply checkout the new branch and the commits should be there

    $ git checkout mybranch

    This process is also useful when you want to move some recent commits to a new branch.

    Yes, use git reflog to find the point just before the git reset. Then you can use something like this

    git reset --hard HEAD@{1}

    They are saved in the new branch you just created.

    git reset --hard mybranch
    Git Baby is a git and github fan, let's start git clone.