What did I just commit?

Written on by Sahil Bhatacharya in Solving Mistories

So, imagine that you just blindly committed changes with git commit -a and you are not satisfied with the particular content of the commit you just created. You can now show the latest commit on your current HEAD with:

git show

or

git log -n1 -p

If you want to see a file at a specific commit, you can also do this (where <commitid> is the commit you're interested in):

git show <commitid>:filename

Sign up below to receive updates, tips and more handy tutorials. It’s good stuff & I don’t spam.