DEV Community

Cover image for TIL that git can checkout commits, not just branches
Steve Ziegler
Steve Ziegler

Posted on

TIL that git can checkout commits, not just branches

You can pass a commit hash to checkout to quickly see a previous version of code. I like to commit often as I get new chunks of partial code working. If I advance to the point of breaking everything, it's an easy way to see what used to work.

git checkout <commit hash>

Top comments (0)