Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore changes to new file from persistent undotree file #176

Closed
ngopalas opened this issue Feb 12, 2024 · 3 comments
Closed

Restore changes to new file from persistent undotree file #176

ngopalas opened this issue Feb 12, 2024 · 3 comments

Comments

@ngopalas
Copy link

I have a persistent undotree file in my .undodir directory. However, due to a version control issue I lost all my changes. I do have the original file, or a file very similar to the original file. Currently when I restored the original file, and I open up Undotree, the undotree is empty. How can I use undotree to recover my lost changes?

@mbbill
Copy link
Owner

mbbill commented Feb 12, 2024

this happens fairly often, and afaik it's not possible to recover with the undofiles once vim believed the file is different from the original.
As stated in the vim help:

"File contents changed, cannot use undo info"
	The file text differs from when the undo file was written.  This means
	the undo file cannot be used, it would corrupt the text.  This also
	happens when 'encoding' differs from when the undo file was written.

@ngopalas
Copy link
Author

Ok thank you, I was able to recover some of the code text changes with the "strings " command. Thank you for responding, and creating this plugin!

@ngopalas
Copy link
Author

In the above I meant "strings .undodir/%filename" command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants