Unless you have saved your session in the cloud, like the previous answer, you can't restore your whole session. You can, however, restore your unsaved (new) notes. They are stored at:
%APPDATA%\Notepad++\backup
You may either open all those files directly in Notepad++, or you can remake the session file in:
%APPDATA%\Notepad++\session.xml
so that the <mainView>
section will include all of them.
Here's a Python script to make it easier to redo the session file. Just paste the output between the <mainView>
and the </mainView>
tags:
import os
import os.path as osp
npp_path = osp.join(osp.expandvars('%APPDATA%'), 'Notepad++', 'backup')
for fn in sorted(os.listdir(npp_path), key=lambda fn: fn.split('@')[1]):
name = fn.split('@')[0]
print('<File firstVisibleLine="0" xOffset="0" scrollWidth="64" '
'startPos="8" endPos="8" selMode="0" lang="Normal Text" '
'encoding="-1" userReadOnly="no" filename="{name}" '
'backupFilePath="{npp_path}\{fn}" originalFileLastModifTimestamp="0"'
'originalFileLastModifTimestampHigh="0" '
'mapFirstVisibleDisplayLine="-1" mapFirstVisibleDocLine="-1" '
'mapLastVisibleDocLine="-1" mapNbLine="-1" mapHigherPos="-1" '
'mapWidth="-1" mapHeight="-1" mapKByteInDoc="0" '
'mapWrapIndentMode="-1" mapIsWrap="no" />'.format(
name=name, npp_path=npp_path, fn=fn))