There is a plugin, based on different answers here: https://github.com/gangleri/vim-diffsaved
It provides the :w !diff % -
method and the more involved diffthis
one.
Apart from that undotree allows this as well, but also much more (diffs between different undo checkpoints). Similar to Gundo.