-2

I have a file and I modified it then commited and pushed. How can I retrieve its org version in GIT? What should I do cause I want its original version back.

baddong
  • 29
  • 1
  • 6

1 Answers1

0

Try accessing your commit log with:

git log

Then, you can revert to a specific commit by copying the SHA, the long string of alphanumeric characters, and entering it in the command.

git revert <insert SHA here>

For more information, check out the docs at http://git-scm.com/docs/git-revert.

EDIT: Note that this will reset your HEAD to the old commit. If you want to just peek at an older version, use checkout as suggested in the comments.

jxexk
  • 36
  • 6