code: def restore_cursor(self):
          
          if self.savepoints:
              savepoint = self.savepoints.pop()
  
              self.g0_charset = savepoint.g0_charset
              self.g1_charset = savepoint.g1_charset
              self.charset = savepoint.charset
  
              if savepoint.origin:
                  self.set_mode(mo.DECOM)
              if savepoint.wrap:
                  self.set_mode(mo.DECAWM)
  
              self.cursor = savepoint.cursor
              self.ensure_hbounds()
              self.ensure_vbounds(use_margins=True)
          else:
              # If nothing was saved, the cursor moves to home position;
              # origin mode is reset. :todo: DECAWM?
              self.reset_mode(mo.DECOM)
              self.cursor_position()
docs: Set the current cursor position to whatever cursor is on top
          of the stack.