Tuesday, May 1, 2018

How to go back to previous version in git

$ git clone [remote_address_here] my_repo
$ cd my_repo
$ git reset --hard [ENTER HERE THE COMMIT HASH YOU WANT]

For example
$ git clone https://github.com/tensorflow/models.git
$ cd ./models
$ git reset --hard 490813bdb3499290633919a9867eb0bb6d346d87 

References:
https://stackoverflow.com/questions/3555107/git-clone-particular-version-of-remote-repository/18037563
https://github.com/tensorflow/models/issues/4002