Hacker News new | ask | show | jobs
by Xurinos 5129 days ago
It becomes dangerous if you have changes in your working tree. You truly lose those changes with a "git reset --hard HEAD" or the forced checkout.
2 comments

Exactly. As mentioned in the article, `git reset --keep` is the preferred way to do it these days. It preserves uncommitted worktree changes.
Oh! I see. I would never do a `git reset` of any kind if I hadn't committed or stashed. Yikes!