开发者

Undo single-file local uncommitted change in egit (e.g. svn revert) [duplicate]

This question already has answers here: Eclipse git checkout (aka, revert) (9 answers) Closed 9 years ago.

Scenario: I have local uncommitted chang开发者_开发问答es to a source file which I want to undo, and get the source file back in its pristine state. In command-line git I would do "git checkout ", but how do I do this in Egit?


See this answer: https://stackoverflow.com/a/4104149/152061 (send upvotes there)

Right click on the file -> Replace With -> Index

(old versions might say File in Git Index rather than Index)

or if you want to undo all files that have changed, right click on the project -> Team -> Reset.. -> select the 'hard' radio button -> press the Reset button


One work round is to select the file, right click > replace with > local history...

select the last commit you did on that file. You can then check it looks ok then replace it in your workspace

Then finally do a new commit that is effectively undoing the change you made, if you have to.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜