GitCheatSheet.org logo
Home / How To

Reset the staging area to a specific commit

git reset abc123

Goes back to commit "abc123" by resetting the staging area to match it, preserving the changed files in the working directory. WARNING: This deletes commits subsequent to "abc123".