Git's command to return to the previous version git reset is to reset the content of the current head without leaving log information. Git reset HEAD filename remove the file git reset -- hard HEAD ~ from the temporary storage area ~ 3. All the latest three submissions will be reset, just as if they were not submitted. Git reset -- hard commit (batch) is rolled back to 38679ed709fd0a3767b79b93d0fba5bb8dd235f8 Based on -- soft -- mixed -- hard, the working tree, index, and HEAD are reset: git reset -- mixed: this is the default mode. git reset without any parameters is used. In this way, it is rolled back to a specific version, only the source code is retained, and the commit and index information is rolled back to git reset -- soft: to a specific version, only the commit information is rolled back, and the data is not restored to the index file level. If you want to submit it, You can directly commit git reset -- hard: To completely roll back to a specific version, and the local source code will also change to the content of the previous version, for example: I want to completely return the previous version. Git reset -- hrad HEAD ~ 1. I want to go back to the last submitted version: git reset -- hard