code: def discard_config(self):
          
          if self.config_session is not None:
              commands = []
              commands.append('configure session {}'.format(self.config_session))
              commands.append('abort')
              self.device.run_commands(commands)
              self.config_session = None
docs: Implementation of NAPALM method discard_config.