Related
Check Repository Status
Display the current state of your working directory and staging area, showing which files are modified, staged, or untracked
Show Changes
Show changes between commits
Commit Changes
Create a commit to permanently record staged changes in the repository history with a descriptive message
Command
git resetExplanation
git reset is used to reset the current HEAD to the specified state. It resets the current HEAD to the specified state.
Examples
Undo last commit, keep changes
git reset HEAD~1Undo last commit and discard changes
git reset --hard HEAD~1Unstage file
git reset file.txtMore
Stash Changes
Temporarily save your uncommitted changes without committing them, allowing you to work on something else and restore them later
Apply Stash
Reapply previously stashed changes without removing them from the stash list
Pull from Remote
Download and integrate changes from a remote repository into your current local branch, combining fetch and merge in one command