0

Is it possible to recover git commit from data that is received from git reflog ?

Example of the git reflog output.

eff9143 HEAD@{14}: merge develop: Fast-forward
e3ad8f7 HEAD@{15}: checkout: moving from develop to master
eff9143 HEAD@{16}: commit: Add Login view. Setting up project structure.
e3ad8f7 HEAD@{17}: checkout: moving from master to develop
e3ad8f7 HEAD@{18}: commit: Add LaunchScreen
Oleg Gordiichuk
  • 15,240
  • 7
  • 60
  • 100

1 Answers1

2

Of course.

Read all about it here: How to move HEAD back to a previous location? (Detached head)

What you can do is to create new branch or reset the current branch to your desired commit and than work on it.

# create new branch 
git checkout -b <name> <sha-1>

# "move" the current branch to any given commit
git reset HEAD --hard

and again all is described in details in the above answer.

Community
  • 1
  • 1
CodeWizard
  • 128,036
  • 21
  • 144
  • 167