score:278

Accepted answer

this can be done via the context menu "replace with/file in git index" on the file in package view.

score:3

the functionality is actually in there, but it may be non-obvious:

  • make sure quickdiff is enabled with a git revision and the quickdiff baseline is head (this is the default).
  • open the file you want to revert.
  • select everything (ctrl-a)
  • right-click in the quickdiff bar
  • select "revert selection"
  • save

btw, revert in git lingo means create a new commit to revert an earlier commit.

score:3

to revert your entire file to repository's data:

click on the folder you wish to do the revision and then go to the gitstaging enter image description here

score:4

open team synchronizing. find the file and right click --> overwrite.

update

in eclipse luna (4.4.2) open team synchronizing. find the file and right click --> "revert..."

score:8

for reverting, you can right click on the file/directory that you want, then select replace with -> head version

score:13

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)

score:15

another possibility is using the git staging view:

  • open git staging view by pressing ctrl+3 or command+3 and typing
    staging
  • in case the view does not already show your repository, click on the project or file
  • you should now see the files you modified in the unstaged changes section
  • double-click on the unstaged file
  • you now see a compare view with your version on the left and the version before the changes on the right

now, to undo only some of the changes in the file, do the following:

  • in the compare view, select one of your changed lines
  • select the copy current change from right to left toolbar item

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:

  • in the staging view, right click on the unstaged file
  • select replace with file in git index

you can also select more than one unstaged file and then right click.

score:18

in eclipse version: 3.7.0

in "team synchronizing perspective" --> right click on file/folder in synchronize view --> overwrite

score:45

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.


Related Query

More Query from same tag