Git command to see old versions of a file.

Often we require to check the versions of the file changes git. There are method in git to do that, but there is other better way to do that.

To view a file of a specific version, below command will show you 5th last commit of

git show HEAD~5:auth/

To get the history of changes

git log -p auth/

# If you want to follow all the changes inclusing file name change you can give --follow option
git log -p --follow  auth/

If you not comforatble with terminal out put, you can use gitk or gitg

gitg auth/

# or with follow 
gitg --follow  auth/


gitk --follow auth/