input: Write a function to implement a basic version control system in Python that keeps track of changes in the code. The function should create a class called VersionControl with an __init__ method that initializes the lines of code and a mark to keep track of the number of commits. The commit method should increment the mark and write the current lines to a log file. The restore method should read the log file and restore the lines of code to the previous commit. If the log file is empty or does not exist, it should raise an exception.
  
  
  class VersionControl:
      def __init__(self, lines):
          self.lines = lines
          self.mark = 0
   
      def commit(self):
          self.mark += 1
          log_file = open("log_file.txt", "a+")
          log_file.write(str(self.mark) + ": " + str(self.lines))
          log_file.close()
   
      def restore(self):
          log_file = open("log_file.txt", "r")
          lines = log_file.readlines()
          to_mark = self.mark-1
   
          self.lines = lines[to_mark]
          log_file.close()
  
  
  assert VersionControl(["print('Hello World')"]).commit() == None
  assert VersionControl(["print('Hello World')"]).restore() == None
output: 
  class VersionControl:
      def __init__(self, lines):
          self.lines = lines
          self.mark = 0
   
      def commit(self):
          self.mark += 1
          with open("log_file.txt", "a+") as log_file:
              log_file.write(f"{self.mark}: {self.lines}\n")
   
      def restore(self):
          try:
              with open("log_file.txt", "r") as log_file:
                  lines = log_file.readlines()
                  if not lines:
                      raise Exception("Log file is empty or does not exist.")
                  to_mark = self.mark - 1
                  if to_mark < 0 or to_mark >= len(lines):
                      raise Exception("Invalid commit mark.")
                  self.lines = eval(lines[to_mark].split(": ", 1)[1])
          except FileNotFoundError:
              raise Exception("Log file does not exist.")
  