Explain it in 60 seconds
Undoing changes in Git
Cloud & DevOps · Git and Version Control · Beginner
What are the common ways to undo changes in Git?
What a strong answer covers
Your AI report card counts how many of these ideas you cover.
- git restore file: discard working changes.
- git restore --staged: unstage.
- git commit --amend: fix last commit.
- git revert: new commit undoing old one (safe for shared).
- git reset: move branch pointer (local history).
Practise this topic
Start without signing up. Sign in free to get an AI report card on your answer.