Rewinds the current branch by a given number of commits.
git reset HEAD~<n>
to rewind the current branch <n>
commits.--hard
flag to uncommit, unstage and delete changes instead.git reset [--hard] HEAD~<n>
git reset HEAD~5
# Rewinds back 5 commits but keeps changes in the working directory
git reset --hard HEAD~3
# Rewinds back 3 commits and deletes changes
Git, Branch
Rewinds the current branch by a given number of commits.
Git, Branch
Discards all uncommitted changes to the current branch.
Git, Branch
Moves local commits from the master
branch to a new branch.