Comment on A safer git checkoutparentComments−Xurinos14yIt 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.−davvid14yExactly. As mentioned in the article, `git reset --keep` is the preferred way to do it these days. It preserves uncommitted worktree changes.−billybob14yOh! I see. I would never do a `git reset` of any kind if I hadn't committed or stashed. Yikes!
Comments
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.
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!