sometimes, HeidiSQL may be stuck or may end to crash. In such case, the unsaved tabs are lost.
It would be great to have a way to keep the tabs content, like Notepad++ does (it keeps the unsaved files on close or crash and restore them on reopening). That could be done by saving all tabs (on change or periodically) in temporary files, and restore them when opening HeidiSQL. When closing a tab, the temporary file would be removed.