Jessica Temporal
About Books Series Talks Videos Socials CV GitStudyCards
🇺🇸 English
  • 🇧🇷 Português
About Books Series Talks Videos Socials CV GitStudyCards
Home chevron_right Blog chevron_right git revert can undo any commit, not just the last one

git revert can undo any commit, not just the last one

calendar_today Updated on: Aug 25, 2026 timer Reading time ~1 minute

You can revert any commit, not just the last one, by passing a commit hash.

git revert followed by the commit hash writes the inverse operations and opens a commit message for you. History stays intact.

Want the full write-up with examples? I covered it here: How to undo changes in a Git repository using git revert

Follow along for more git tips like this!

animated jess' signature

Related Articles

git

How to undo changes in a Git repository using git revert

Learn how to use git revert and reverse changes

git

Undoing more than one commit at once with git revert

Learn how to revert a range of commits in one command with git revert, including the A..B notation and when to use --no-commit.

git

Undo anything in Git: reset vs revert, explained

Learn how to undo any commit in Git with reset, revert, and reflog — without losing your work.

« What building My Yarn Stash taught me about working with AI git reset --soft: undo a commit without losing your changes »
school
pro tip

Related Articles

  • How to undo changes in a Git repository using git revert

    Dec 1, 2023

  • Undoing more than one commit at once with git revert

    Jun 28, 2026

  • Undo anything in Git: reset vs revert, explained

    Jul 30, 2026

All rights reserved by Jessica Temporal

mail