Take the 2-minute tour ×  Undo is nice to have in Vim. But
sometimes, at a known good point, I want to erase my undo
history - to be able to use u to undo individual changes, but
only back to a certain point. (For instance, this might be when
I last committed.)  One way to accomplish this would be to close
and reopen the file - the undo history starts clean at that
point. But that's a hassle.  In the past, I accomplished this
with :edit!. But in Vim 7.3, that doesn't discard the undo
history.  Is there another way to do this, apart from closing
the file?  share|improve this question so you actually just want
to restore the state of the file as it was on your last commit?
you want essentially just remap the 'u' key to something like
git checkout -f file or hg rollback file? –  akira Nov 24 '10 at
18:34 @akira - no, I want to be able to use u to undo individual
changes, but not past the point where I last committed. Exactly
as if, every time I committed, I closed the file and re-opened
it. Which is what :edit!