Suggest an editImprove this articleRefine the answer for “What does "undoing changes" mean in Git?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)**Undoing changes in Git** is returning files or the state of the repository to a previous state, at the level of the working directory, the staging area, or the commit history. **Key point:** undoing is not a single command, it is a set of actions that can either change the history (reset, commit --amend, rebase) or leave it unchanged (revert).Shown above the full answer for quick recall.Answer (EN)Image**Undoing changes in Git** is returning files or the state of the repository to a previous state. ## What undoing can mean Depending on the situation, undoing can mean different things: 1. **Undoing changes in the working directory** Returning files to the state of the last commit or the staging area. 2. **Undoing an addition to the staging area** Removing files from the index (unstage), while the changes in the files themselves are kept. 3. **Undoing a commit** Either removing the commit from the history, or creating a new commit that undoes its changes. 4. **Undoing part of the history** Returning a branch to an earlier commit. ## Levels at which changes can be undone Git allows undoing changes at different levels: - the working directory - the staging area (index) - the commit history ## Important - undoing can **change the history** (`reset`, `commit --amend`, `rebase`) - or **not change the history** (`revert`) ## Key idea for an interview > Undoing changes in Git is not a single command, it is a set of actions that return files or the history to the state you need, depending on where the changes are and whether they were committed.For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.