Git commit error rollback method: directly roll back the latest commit: git reset --hard HEAD~1 roll back to a specific commit: git reset --hard
roll back to a specific file : git checkout -- Force rollback (caution required): git push --force origin
How to roll back a Git commit error
Roll back the latest commit directly
.
Rollback to a specific commit
.
with the hash of the commit you want to rollback to.
Rollback to a specific file
.
Force rollback
.
Other Notes
command to view the differences between the code before and after the rollback.
The above is the detailed content of How to roll back a git commit error. For more information, please follow other related articles on the PHP Chinese website!