How to uncommit my last commit in Git [duplicate]
问题 This question already has answers here : How do I undo the most recent local commits in Git? (81 answers) Closed 3 years ago . How can I uncommit my last commit in git? Is it git reset --hard HEAD or git reset --hard HEAD^ ? 回答1: If you aren't totally sure what you mean by "uncommit" and don't know if you want to use git reset , please see "Revert to a previous Git commit". If you're trying to understand git reset better, please see "Can you explain what "git reset" does in plain English?".