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
Subscribe to get resources directly to your inbox. You won't receive any spam! ✌️