git reset --soft HEAD~1Undoes the last commit but keeps all changes staged. Safe operation.
git reset --hard HEAD~1Completely removes the last commit and discards changes. Cannot be undone!
git restore --staged <file>Removes a file from the staging area without deleting changes.
git checkout -- <file>Reverts a file to its last committed state. Changes are lost.