Patricia Sauer - Authentic Programming

Check out a file as it was on a specific commit | The Git Checkout Command

A person in blue denim jacket using macbook pro

Sometimes you want to check out a file as it was on a specific commit. You can do this easily by using the Git checkout command:

git checkout commitSha -- insertFileNameHere

To check out the file Controller.java, you could do the following:

git checkout 61b04017a359339d191143cc5a2269bf06acd9e2 -- Controller.java

Reference

For full reference see Git checkout documentation.

Liked this article?

Buy Me A Coffee

© 2018 - 2024 Patricia Sauer