GIT un-rollback a commit

git

Solution

Use `git log -g` or `git reflog` to see the reflog -- the log of all of the values that a given `HEAD` has taken on. Think of it as a chronological history of HEAD rather than a checkin history.

Once you find it you can `git reset` back to it (possibly after creating a branch specifically to point to it) or cherry pick part of it that you want.

Problem

I did a commit and push on my git repo. I then needed to rollback that commit which I did like this: ``` git reset --hard b1b5768c9687455f01bab242ff177a5ee403104f ``` Is it possible to find the SHA of the first commit? and go back to it again?

Original source