Git Checkout FileIf you stage and commit the checked-out file, this has the effect of “reverting” to the old version of that file. Note that this removes all of the subsequent changes to the file, whereas the git revert command undoes only the changes introduced by the specified commit.
To perform the reverting action click on the 'Team>Revert...' menu item of the resource pop-up menu 'Revert...' menu item of the 'SVN main menu group'. The dialog allows the user to choose which resources changes to revert and provides a probability to remove unversioned resources.
This can be done via the context menu "Replace with/File in Git index" on the file in package view.
You can achieve this by doing a (hard) reset. On the project's context menu, select Team > Reset to..., choose "HEAD" and "Hard" as reset type.
Please note that doing this you will lose the changes of ALL files. To revert just a single file see this answer.
in Eclipse Version: 3.7.0
in "Team Synchronizing perspective" --> right click on file/folder in synchronize view --> overwrite
Another possibility is using the Git Staging view:
staging
Now, to undo only some of the changes in the file, do the following:
This will make the left side correspond to the right side for this change. Save the file to finish the undo.
To undo all of your changes:
You can also select more than one unstaged file and then right click.
Revert a single file by going to Window > Show View > Other > Git Staging > Unstaged Changes
Select the file(s) you wish to revert. Right click and choose Replace with HEAD revision
Note that this step can't be undone.
(I am using Eclipse Version: 3.7.2 Egit version 2.3.1.201302201838-r)
For reverting, you can right click on the file/directory that you want, then select Replace With -> HEAD version
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With