Method:
Depending on the –soft–mixed–hard, the working tree and index and head are reset:
git reset--mixed: This is the default, git reset without any parameters, this way, it rolls back to a version, only retains the source code, fallback commit and index information
git reset--soft: Fallback to a version that only returns the commit information and does not revert to the index file level. If you want to submit it, you can do it directly.
git reset--hard: Completely fallback to a version, the local source code will also become the content of the previous version, this command is used with caution!
HEAD Last Commit
head^ Last submitted
head^ ^ Last last commit (third countdown)
head^ ^^ The penultimate submission of the fourth time
----------------------
Head~0 recently submitted
Head~1 Last submitted
head^2 Last Last commit (third time countdown)
Head^3 Fourth-time submission of the countdown
Git Deletes an error committed commit