Posted almost 12 years ago. Visible to the public. Linked content.

Git: Revert one or more commits

Reverting a commit means creating a new commit that undoes the old changes.

Imagine the following commit history:

* commit_sha3 [Story-ID 1] Fixup for my feature * commit_sha2 [Story-ID 5] Other feature * commit_sha1 [Story-ID 1] My feature

You can revert a single commit using the following syntax:

git revert commit_sha2

To revert changes that are split across multiple commits, use the --no-commit flag.

git revert --no-commit commit_sha3 git revert --no-commit commit_sha1 git commit -m "Revert Story 1"

Your development team has a full backlog of feature requests, chores and refactoring coupled with deadlines? We are familiar with that. With our "DevOps as a Service" offering, we support developer teams with infrastructure and operations expertise.

Owner of this card:

Tobias Kraze
Last edit:
about 3 years ago
by Besprechungs-PC
About this deck:
We are makandra and do test-driven, agile Ruby on Rails software development.
License for source code
Posted by Tobias Kraze to makandra dev
This website uses short-lived cookies to improve usability.
Accept or learn more