Only if the last window you close is the one with the pinned tabs, otherwise they're gone and there doesn't seem to be a "re-open pinned tabs" option to retrieve them either. So at this point, the only effective solution is to use the bookmark bar and avoid pinned tabs. After I erased them accidentally once, I'm not wasting time with that "feature" again.