It can be frustrating when your computer has shut down in the middle of some sql-session and you’ve seemingly lost your work. SSMS keeps backup-files though, but the location of these seem to vary a bit between installations and local setup. In my case on it is
C:\Users\WIN_USERNAME\Documents\Visual Studio 2017\Backup Files\Solution1
Navigating to this location (or similar depending on your setup) you will find various backup and recovery files from your earlier sql-sessions. At least from my experience it seems pretty much everything is saved so you shouldn’t have too much about losing your work when working in SSMS.