Search or browse grouped Git commands to find the exact syntax for tasks like committing, branching, rebasing or undoing changes, with a short note on each.
Use git reset --soft HEAD~1, which moves the branch back one commit while leaving your changes staged.
Merge preserves history with a merge commit; rebase replays your commits onto another branch for a linear, cleaner history.
git checkout -- file (or git restore file) reverts the file to the last committed state, discarding uncommitted edits.