How to undo all changes in a buffer made since it was open in Vim?

后端 未结 7 746
执念已碎
执念已碎 2021-01-30 08:38

How can I undo all changes since opening a buffer? I imagine there may be some form of :earlier that does this.

Update: Many are suggesting

7条回答
  •  温柔的废话
    2021-01-30 09:23

    A graphic solution:

    The Gundo plugin allows visual comparison of changes in the undo history.

    Open Gundo's "undo history pane", type G go to the last line, then we can back to the original file.

提交回复
热议问题