View an older version of a file from a previous commit with GIT

Here is the command:

git show COMMIT_NAME:path/to/file/from/git/repo/root/

You can also:

  1. Download SmartGit
  2. Add your repo
  3. Click “Log”. That will show you a list of all your commits.
  4. As you click on an older commit, on the bottom left hand corner there is a pane called “Files” which shows you all the files that changed in that commit
  5. When you click on a file, it shows you how it changed (the diff) in the two panes to the right. That’s pretty nifty too :)

Leave a Reply

Your email address will not be published. Required fields are marked *

This blog is kept spam free by WP-SpamFree.

Get Adobe Flash player