code: def revert(self):
          
          index = self.get_stack_index()
          finfo = self.data[index]
          filename = finfo.filename
          if finfo.editor.document().isModified():
              self.msgbox = QMessageBox(
                      QMessageBox.Warning,
                      self.title,
                      _("All changes to <b>%s</b> will be lost."
                        "<br>Do you want to revert file from disk?"
                        ) % osp.basename(filename),
                      QMessageBox.Yes | QMessageBox.No,
                      self)
              answer = self.msgbox.exec_()
              if answer != QMessageBox.Yes:
                  return
          self.reload(index)
docs: Revert file from disk