2

I am trying this

git reset --hard 4eb38c748f77b51ffcde8684dfea173af2e33e7b

I am getting an error

fatal: Could not parse object '4eb38c748f77b51ffcde8684dfea173af2e33e7b'.

Why would I get this error? How can I fix my command?

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
Veena
  • 29
  • 5
  • This answer could help U https://stackoverflow.com/questions/4114095/how-do-i-revert-a-git-repository-to-a-previous-commit – Yoandry Collazo Aug 23 '20 at 16:57
  • 1
    This message indicates git could not find this commit in its store. Can you indicate how you found this hash ? – LeGEC Aug 23 '20 at 21:38

1 Answers1

1

First, make sure you have all the latest commits:

git fetch

Second, try and git rev-parse the first 7 or 8 characters of your SHA1

git rev-parse 4eb38c7

If there is a unique existing commit SHA1 starting with 4eb38c7, that command will display it completely.
You can then compare with the full SHA1 string you were trying to use: maybe there was a typo in it.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250