When you accidentally close a tab in Safari and then hit Command-Z to restore it, not only does it restore the browsing history of the tab but it also retains the buffered state of any videos you may have hit Play on before you closed the tab.

Here are a couple more pieces of trivia about the undo behaviour in Safari:

If you accidentally close a tab, make sure you are not on a page where you have entered text into a form field before you hit the undo shortcut. If you are, the undo command will remove the last typed text in the form field instead of restoring the closed tab and sometimes won’t even let you undo the undo by hitting Command-Shift-Z. This is a very frustrating behaviour and I’ve lost quite a bit of stuff that I’ve written in blog posts due to it, including the opening paragraph of this post itself.

Also, the undo last closed tab command works on a per window basis, so you can hit Command-Z to restore the last closed tab in separate windows without there being any overlap. Pretty handy.