How do I view history of an individual file?


This seems like such a simple requirement that I get the feeling I am being super-stupid here, but I can't figure out how to view the history of an individual file.  The problem has two parts:

  1. How can I see all the files in a project, so I can choose the file I want to see the history of?  (At the moment, I use Visual Studio for this.)
  2. Once I have picked the individual file, how do I view its history (and preferably have the option of reverting to an older version)?

I'm guessing this must be possible somehow because I have just been reading an Atlassian Git tutorial, which mentions being able to retrieve an older version of a file in such a way that it does change the current working copy of your project.  The command, I believe, is:

git checkout a1e8fb5

Any help would be very much appreciated.


Kind wishes ~ Patrick


1 answer

1 accepted

2 votes
Accepted answer

To see all files, change the dropdown above the file list from "Pending files" to "All files". You can then use the search bar to the right to filter the list based on filename.

When you have found the file you want, right-click and choose "Log Selected...". In the Log Selected window, you can select a commit and choose "Reset to commit..." to replace your working copy with that version of the file.

Ha ha - the key part I was missing was the right-click to get Log Selected.

Thank you!

Thanks for the answer, needed this, hardly obvious.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Oct 23, 2018 in Sourcetree

Tip from the team: configure your repos for hosting goodness!

Supported Platforms macOS Windows We recently introduced support for additional hosting services such as GitHub Enterprise, GitLab (Cloud, Community Edition, Enterprise Edition), and...

1,110 views 4 2
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you