Restore a file from the index or another branch

$ git restore [path]
$ git restore -p [path] # discard specific chunks
$ git restore . # discard all local changes
  • git