Tuesday, May 31, 2011

Re: Restore file from undo

Reply to message «Re: Restore file from undo»,
sent 15:50:06 31 May 2011, Tuesday
by Vsevolod Velichko:

> Christian, thanks for your answer.
> Yes, all the files I've lost were created from scratch, so I suppose,
> that undofile contains all the file history (undolevels=1000 should be
> sufficient for every file).
If files are so small that undolevels=1000 is sufficient, maybe you should
retype them instead?

There are additional options: for ext* filesystems you may use extundelete
application and for every filesystem you may open its device as a file and
search for parts of the text you still remember. Before doing the latter, ask
somebody for application that is able to do the job, Vim is not a good option
for this. I once did something similar with grep.

And I guess you now know why people use backups. Mercurial+bitbucket.org or
something similar for your code can also serve for this need.

Original message:
> Hello,
>
> Christian, thanks for your answer.
> Yes, all the files I've lost were created from scratch, so I suppose,
> that undofile contains all the file history (undolevels=1000 should be
> sufficient for every file).
>
> ----
> Best wishes and have a nice day,
> Vsevolod Velichko
>
> 2011/5/31 Christian Brabandt <cblists@256bit.org>:
> > That would only work, if you had previously reloaded your whole buffer
> > using :e! and 'undoreload' was set to a negative number (or you file
> > contained less than that number of lines). If you know, the whole
> > file content was previously saved in your undofile and you'd like to
> > try out reloading your changes, let me know. I made a patch, that
> > enables you to force reloading the undo history, which you could try out
> > if you want. But that is not very useful by itself.
> >
> > regards,
> > Christian

No comments: