So, you were editing a file on production machine to debug an issue.  Once you are finished you want to reset it back to what was in git.

  1. delete the file.

2. git checkout HEAD <filename>

This will restore the file to the last pull or fetch. v( local git repository )

However, when you pull again.  it will show that it has changed.

You have to stash it.  or perhaps just delete it again.

Leave a Reply