Eclipse's local history…where are files saved?

后端 未结 6 549
梦谈多话
梦谈多话 2020-12-15 16:55

Can someone explain how Eclipse\'s local history works?

I accidentally overwrote a file in a project but need to revert to an earlier version. Is there a chance that

6条回答
  •  情歌与酒
    2020-12-15 17:28

    VonC's answer has all the information you need for finding the location of your code backups. I would simply add that if you are on a Mac or Linux, you can do something like this:

    $ cd [WORKSPACE]/.metadata/.plugins/org.eclipse.core.resources/.history/
    $ grep -rl "class Foo" . | xargs ls -lt
    

    This will find all the versions of a file that contains a particular string (ie. "class Foo"), and sort them by date/time to easily find the most recent version.

提交回复
热议问题