lisak
lisak

Reputation: 21981

How to checkout a file into previous revision in egit

could please anybody tell us if it is possible and if it is not, what is the best alternative to do it ? This is how it would be done in command line : git checkout HEAD~1 -- path/to/file

But if the project is big, navigating to that file in cmd can be annoying ....

Upvotes: 7

Views: 6423

Answers (3)

Matthias Sohn
Matthias Sohn

Reputation: 272

This is available in EGit 2.0:

Select the file(s)/folder(s) you want to replace with another version and use any of the commands:

  • "Replace with > Commit..."
  • "Replace with > HEAD revision"
  • "Replace with > Branch, Tag, or Reference"
  • "Replace with > File in Git Index"

Upvotes: 5

Jim Hurne
Jim Hurne

Reputation: 7369

You can do this with EGit version 1.0 or higher (it might also be possible with earlier versions, but 1.0 is the first version I noticed the feature).

  1. Right-click on the file you wish replace with an earlier commit, and select Replace With -> Commit...
  2. You will be presented with a list of commits to choose from. Select the commit you wish to replace the file with.

Upvotes: 12

cmcginty
cmcginty

Reputation: 117176

I know you can reset your full history to a previous commit. I don't know about just one file.

This is why I don't recommend anyone using Egit. You will out grow it in a few days of usage.

Upvotes: -4

Related Questions