input: Write a function to implement a basic version control system in Python that keeps track of changes in the code. The function should include an initialization method, a commit method to append the current state of the lines to a log file, and a restore method to revert to the state before the last commit. If there are no changes to commit or to restore, the system should handle it gracefully.
  
  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!")', 'print("Version Control!")']).commit() == None
  assert VersionControl(['print("Hello World!")', 'print("Version Control!")']).restore() == ['print("Hello World!")']
output: def __init__(self, lines):
      self.lines = lines
      self.mark = 0
  
  def commit(self):
      if self.lines:
          self.mark += 1
          with open("log_file.txt", "a+") as log_file:
              log_file.write(str(self.mark) + ": " + str(self.lines) + "\n")
  
  def restore(self):
      if self.mark > 0:
          with open("log_file.txt", "r") as log_file:
              lines = log_file.readlines()
              if self.mark <= len(lines):
                  self.lines = eval(lines[self.mark - 1].split(": ", 1)[1])
                  self.mark -= 1