When you have messed up a file or made temporary changes locally (e.g. for debugging) and you want to get rid of the local changes, there is an easy way out.
Git – Refresh a File or Folder from the Remote Branch

When you have messed up a file or made temporary changes locally (e.g. for debugging) and you want to get rid of the local changes, there is an easy way out.