If you’re using reset with uncommitted changes and you’re not intentionally throwing them away, you’re doing something wrong. git reset —hard means “fuck everything, set the state to X”. I only ever use it when I want to throw away the current state.
Using git reset --keep would just make more work since I’ll have to throw away uncommitted changes anyways. Removing uncommitted changes is kind of the whole point, it is called ‘reset’ after all. If I want to preserve uncommitted changes, I’ll either stash them or commit them to a temporary branch. That has the added benefit of adding those changes to the reflog so if I screw up later I’ll be able to recover them.
If you’re using reset with uncommitted changes and you’re not intentionally throwing them away, you’re doing something wrong.
git reset —hard
means “fuck everything, set the state to X”. I only ever use it when I want to throw away the current state.Well yeah I think the point is you’re human and you might make a mistake.
Let me live with my mistakes
Using
git reset --keep
would just make more work since I’ll have to throw away uncommitted changes anyways. Removing uncommitted changes is kind of the whole point, it is called ‘reset’ after all. If I want to preserve uncommitted changes, I’ll either stash them or commit them to a temporary branch. That has the added benefit of adding those changes to the reflog so if I screw up later I’ll be able to recover them.Waddyamean “that’s what backups are for”Sorry, wrong communityNot many people back up continuously, so this is still useful.