git Tutorial
Git: Undo Commit
By Xah Lee. Date:
2022-09-09
. Last updated:
2023-07-28
.
How to undo commit?
git reset --soft HEAD^
reset to last commit, but keep your changes
git reset --hard HEAD^
reset to last commit, THROW AWAY ALL YOUR CHANGES
git FAQ
Unadd File
Undo Commit
Fix Last Commit Message
Revert to Old
git config
Setup Name and Email
Git Ignore File
Git Config Line-Ending for Windows
git FAQ
Delete Untracked Files
What is HEAD
Fix Detached Head
git
Install git
Git Basics
git help
Create a Project
Clone a Project
Commit Files
Push to Server
Pull from Server
Commit ID
Find Difference
View Log
Git Blame
Branching
Archive; Zip
Temp Save: git stash
git FAQ
Unadd File
Undo Commit
Fix Last Commit Message
Revert to Old
git config
Setup Name and Email
Git Ignore File
Git Config Line-Ending for Windows
git FAQ
Delete Untracked Files
What is HEAD
Fix Detached Head