code: def reset_spyder(self):
          
          answer = QMessageBox.warning(self, _("Warning"),
               _("Spyder will restart and reset to default settings: <br><br>"
                 "Do you want to continue?"),
               QMessageBox.Yes | QMessageBox.No)
          if answer == QMessageBox.Yes:
              self.restart(reset=True)
docs: Quit and reset Spyder and then Restart application.