Patch Set 2: I would prefer that you didn't submit this

I did this for a project that was shared but had some untracked files (.classpath was the actual offender here) and got the Exception below (the TreeWalk is null as the file under the path is not tracked).

java.lang.NullPointerException
	at org.eclipse.egit.core.op.ReplaceFromHEADOperation.discardChange(ReplaceFromHEADOperation.java:52)
	at org.eclipse.egit.core.op.DiscardChangesOperation.discardChanges(DiscardChangesOperation.java:114)
	at org.eclipse.egit.core.op.DiscardChangesOperation.access$0(DiscardChangesOperation.java:98)
	at org.eclipse.egit.core.op.DiscardChangesOperation$1.run(DiscardChangesOperation.java:91)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1800)
	at org.eclipse.egit.core.op.DiscardChangesOperation.execute(DiscardChangesOperation.java:94)
	at org.eclipse.egit.ui.internal.actions.DiscardChangesActionHandler$1.run(DiscardChangesActionHandler.java:85)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)