-1

I deleted a branch that i want to restore. I tried to recover it and the only thing i could find is a commit from git-log running: git log -p 4afa3abc4218b6251dea24c910eaced6af465d11. Also - it seems that this SHA appears only on my local mac (when my colleague run this git-log command he gets an error)

I can see the changes in the output and i would like to create a brand new branch from this git log output.

How can i easily do that?

shayms8
  • 671
  • 6
  • 13
  • 28

1 Answers1

2

Just check out the commit and create the branch.

git checkout 4afa3abc4218b6251dea24c910eaced6af465d11
git branch yourbranch
KamilCuk
  • 120,984
  • 8
  • 59
  • 111
  • 1
    Perhaps `git checkout -b yourbranch 4afa3abc4218` so that you are on the branch and not in detached HEAD state. – j6t Jun 29 '22 at 11:34