Revert modifications from a git project in Eclipse IDE

Something that I’ve missed when I switch from SVN to git was subeclipse:(

I’m using eGit, but it lacks support for doing a simple task like reverting modifications from a specific file.

eGit without reverting
eGit without reverting

Even though I’m getting use to those simple command line scripts a simple thing like reverting modifications from a specific file is kind of tedious, and this is something that I could handle in the IDE.

To simplify this procedure I’ve created a simple bash script (

# @author Daniel Botelho <>
# @date 2010-05-19
cd $workspace_loc/$project_name
#echo $git status

#$git status

echo $git checkout ${selected_resource_path:length}
$git checkout ${selected_resource_path:length}
echo “completed.”

Then I’ve created a new External Tool Configuration to call this simple script (Run>External Tools> External Tools Configurations…>)


Screenshot-External Tools ConfigurationsHere you should change your “Location” to the location where you have your “” script.

Ok, and it’s done! :)

Now I can choose the file that I want to revert and click on “Run revert modifications (git)” right from the eclipse IDE.