0

Suppose following scenario.

  1. Create a branch in a local git repository on the master branch.

  2. Checkout new branch and do some commits.

  3. Checkout master branch again.

  4. Delete the newly created branch.

Now, Is there a way to go back to the last commit I made in the newly created branch if I do not remember the commit id of it?

Lahiru Chandima
  • 19,524
  • 18
  • 91
  • 154

1 Answers1

0

You can do a:

git checkout HEAD@{1}

or if you use a recent version of git:

git checkout -
Yves Blusseau
  • 3,964
  • 4
  • 15
  • 7