The Importance of Paying Attention

These are the commands I just entered:

  • git add .
  • Oops, that included target/. I’ll undo that add…
  • git reset --hard HEAD

That second command isn’t, “undo the last add”, it’s “reset the sources to the previous version.” That means my work from the last day and a half is now gone. Grr… The command should have been just:

  • git reset

Leave a Reply

Your email address will not be published. Required fields are marked *