Is there a way to revert to the original contents of a source code file?

Yes, if undesired changes were made to source file, there is a way to revert to the previous file. In order to do this follow steps below:

  1. Right-click the source file and select Replace With > Local History f rom the context menu.

    The Compare view appears.

  2. Double-click Revision Time .
  3. Double-click Revision Time tab.

    The Compare window appears.

  4. Select Replace .

The file is replaced.

Note: Another way to replace the file is to select Replace With > Previous from Local History from context menu and this command replaces the file with the last file that you saved.