input: Write a function to implement a basic version control system in Python that keeps track of changes in the code. The class VersionControl should have methods for committing changes and restoring to a previous state. If no previous state exists when restoring, the system should maintain the current state.
  assert VersionControl(['print("Hello")', 'print("World")']).commit()==None
  assert VersionControl([]).commit()==None
  assert VersionControl(['print("Hello")', 'print("World")']).restore()==None
  assert VersionControl([]).restore()==None
output: class VersionControl:
      def __init__(self, code):
          self.code = code
          self.history = []
  
      def commit(self):
          self.history.append(self.code)
  
      def restore(self):
          if self.history:
              self.code = self.history.pop()
          else:
              pass