Is there any way available to restore my unsaved python script in qgis? Yesterday I forget to save my scripts and now I open QGIS project I lost my all three scripts.

I used notepad++ or different IDEs that automatically save all your scripts but I guess this feature is not available in QGIS.

1 Answer 1


It may be possible to restore unsaved scripts (provided the temporary files are not deleted) as mentioned by Nyall Dawson in the ChangeLog for QGIS 2.14.2:

[console] Allow running unsaved script files

Previously a (non-default) option existed for auto-saving scripts on run, which would overwrite the existing script file if set, or save the script to a temporary file before running.

Now, the auto-save option only applies to scripts which have already been saved an have a filename. By default the console now can run scripts without filenames, or scripts with changes by transparently saving them out to a temporary file.

I haven't tested this but my guess is the scripts are saved in your TEMP folder and depending on your system configuration, could still be there.

On Windows 10 you can open an Explorer Window and type in %temp%. Then search for the latest .py files.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.