I sometimes screw up my local git repo so badly that I need to just wipe it out and start again from the latest commit on remote
. Is there a correct way to do this with git, or should I just delete the local repo and pull
again? I tried the answer to this post, but my local repo was still detached from HEAD
.
Here's one example to prevent anyone from asking why I want to do this instead of fixing my mistake. I somehow ended up with a detached HEAD
, and other SO posts indicate it's a PITA to fix. My latest commit on remote
is fine, I've only changed one file, so I saved my changes and just want to start fresh instead of trying to fix the detached HEAD
.