Git Commands You're Always Forgetting | HackerNoon
Briefly

The git restore command is handy for discarding changes in the working directory. If you've accidentally made changes to a file, git restore will revert it.
The git reset --soft HEAD~1 command undoes the last commit but keeps changes in the working directory. This is useful for when you've committed too early.
Stashing saves your local changes so you can work on something else without committing. The --patch flag allows you to select changes to stash interactively.
The git worktree command allows multiple working directories with different branches checked out, letting you work on another branch without losing current changes.
Read at Hackernoon
[
]
[
|
]