0

I am using git local repository to create code commits. Till now I have made 8 commits in my local repository. For testing some previous commits (number 2) I used git reset oldcommithashfornumber2 But now I want to go back to lasted 8th commit. But somehow I am stuck.

As this is local repository there is nothing to pull from remote origin.

prasad
  • 219
  • 3
  • 17
  • For future reference, when you want to switch to an old commit without losing newer commits, you should use `git checkout` rather than `git reset`. – Amber Jan 22 '19 at 04:54
  • if you now have no branch pointing to where your master used to be, you might have to run `git reflog` and see if one of those hashes is your commit number 8 (this can be by trial and error, `git checkout `). – zoran119 Jan 22 '19 at 04:56

0 Answers0