reset hard git command code example Example: git reset Click to copygit reset --soft HEAD~3 git commit git push —force-with-lease origin