How to check out a specific git commit of transformers?

I am a newbie with git. I cloned hugging face’s transformers from git with:

git clone https://github.com/huggingface/transformers

And then I wanted to get a specific commit with the commit hash. I used the git checkout #######

I get this error:
fatal: reference is not a tree:

What am I missing?

Solution found: I used:

pip install git+https://repofullURL.git@LONGHASHVALUESGOESHERE