If you modified a file that was not submitted to the local library (add index), how do you restore it? The Git plugin does not provide a restore method directly as the SVN plugin does. In fact, whether you commit to a local library or a remote library, the essence of the restore operation is to restore the current version of the file to a previous version, because Git will record each modification as a new version. The following are the steps:
1. To restore the index2.html file as an example, open the index2.html file,
2. Right-click on the file, select Team menu, then select Show Local History menu,
3. In the right-hand file Modification History list, select the historical version you want to view, right-click,
4. In the right-click menu, compare current with local can be different than the selected version and the local version of the file:
5. After the comparison, if it is to restore to the version, then click on the right menu get contents start to restore the file, this will pop up the prompt box,
6. Prompt box: Ask if you want to overwrite the current file with the selected version file, click Yes to complete the restore, click Cancel.
Precautions
Git will record every modification as a new version.
Git plugin restore files in eclipse