3

I have an eclipse workspace with a bunch of projects from git, I am using egit to manage the project. I typically try out experiments which fail, and I want to take a project and restore it to exactly its state in HEAD of the git repo.

How do I do that with EGit?

I have tried to right click on the project Replace With > Head Revision which causes eclipse to crash. I am new to git migrated from svn. is there an equivalent of svn revert for a project?

ams
  • 60,316
  • 68
  • 200
  • 288
  • Worth checking which version of EGit you have as 1.3 was released a few days ago. Crashing doesn't sound like a reasonable response if the 'replace with head revision' isn't supported yet. – SteveD Feb 20 '12 at 09:22
  • updated to egit 1.3 it seems faster and better. – ams Feb 21 '12 at 21:16

1 Answers1

2

If you don't have any non-versioned files (ie "private" files) that you don't want to lose, then you can try and reset your working tree to your current HEAD.

See "Resetting your current HEAD ", choosing the "hard" option.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • "Resetting to current Head" seems to do it for the whole repo rather than just an individual project in the repo, any way to do it for an individual project? – ams Feb 20 '12 at 18:54
  • doing stuff on a pre project basis in git seems to be against the way that git thinks, git seems to be always operating on the whole repo. – ams Feb 25 '12 at 07:43