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
  • 22,324
  • 22
  • 103
  • 179

1 Answers1

0

You can do a:

git checkout HEAD@{1}

or if you use a recent version of git:

git checkout -
Yves Blusseau
  • 4,244
  • 4
  • 16
  • 7