Before you start working on a file you need to check it out. To checkout a file you can right-click the file in the solution explorer and select 'Checkout' or open it in the VS editor and press the Checkout toolbar button. If you open a file in the VS editor which is not checked out and try and edit it, you will be asked if you want to checkout the file.
You can tick the 'Don't show this dialog again' checkbox so that files are automatically checked out when you start editing them.
To revert the changes you have made to a file you can right-click the file in the solution explorer and select 'Revert' or open the file and press the 'Revert' toolbar button. This will revert the changes and reload the file in Visual Studio.
The quickest way of reverting all your changes is to open the Changesets View as described in the section called “Changeset View”. From here you can delete the local changeset.
'Show File Differences' will show the differences between the file on your machine and the server version of the file. Right-click the file in the solution explorer and select 'Show Differences' or open the file in the VS editor and press the 'Show File Differences' toolbar button.
This will launch the File Differences Tool as described in Chapter 7, File Differences Tool.
'Show File History' will launch the File History dialog where you can view all revisions of the file and compare or revert back to each revision. The File History dialog is described in Chapter 9, File History. Right-click the file in the solution explorer and select 'Show History' or open the file in the VS editor and press the 'Show File History' toolbar button.
File Annotated History
The annotated history of a file shows the history of each line, so you can see who, when and why each line was last changed. To view the annotated history right-click the file in the solution explorer and select 'File Annotated History' or open the file in the VS editor and press the 'Show File Annotated History' toolbar button.
The Annotated History tool is described in Chapter 10, File Annotated History.