Advanced Manipulations
git reset
Description
Usage
git reset [<mode>] [<commit>]Options
git reset --soft HEAD~1
git reset HEAD~1
git reset --hard HEAD~1
git reset --keep HEAD~1
git reset --merge HEAD~1Modes
Common Use Cases
Example Workflow
When There Are No Changes in the Working Directory
When There Are Changes in the Working Directory
When There Are Changes in the Working Directory and Staged Changes
When There Are Changes in the Working Directory, Staged Changes, and Commits
When There Are Changes in the Working Directory, Staged Changes, Commits, and the Commit Has Been Pushed to Remote
git reflog
Description
Usage
What It Does

Common Use Cases
Example Workflow
git cherry-pick
Description
Usage
Options
What It Does
Common Use Cases
Example Workflow
Scenario: Hotfix on a Production Branch
Handling Conflicts During Cherry-Picking

Last updated