git reset HEAD
Go back to the previous version, but the content modified on the basis of the previous version is still
git reset --hard HEAD
Back to the previous version, the modified content is gone.
Such as: modify the code, add "third submission"
submit
Git reset HEAD~1
Reverted, but the "third submission" is still there
If you use: git reset HEAD~1
The "third submission" is gone