Skip to main content

Revert Changes

This page shows how to revert a committed change to a specific branch or default branch in Git, allowing you to fix a mistake or undo an unwanted change.

You can revert changes from Git user interfaces provided by some platforms, but it is recommended to perform reverts from the local system using Git commands.

  1. Open your App Git repository and clone it to your local system.

  2. Switch to the branch where you want to revert the change:

git checkout <branch-name>
  1. To identify the commits, in the terminal use:
git log

This displays a list of commits in reverse chronological order, starting with the most recent commit. Each commit entry includes information such as the commit hash, author name, date, and commit message, like:

  1. To revert a commit, use the git revert command followed by the commit hash:

Example:

If you want to revert a single commit:

git revert 2f50d7dd1dc4874b7ca6054099b54

If you want to revert multiple commits:

git revert 2f50d7dd1dc4874b7ca6054099b54^..af0e737a28e0d5c816912a336

//git revert <commit-hash-1>^..<commit-hash-2>

Make sure to revert changes in chronological order, starting with the newest commit first.

Some Git platforms, like GitHub & GitLab, also offer a graphical user interface that allows you to revert changes directly from the platform's interface.

  1. If there are conflicts during the revert process, resolve them manually by editing the conflicting files and then continue with the revert process.

  2. After resolving conflicts (if any), commit and push the changes to your remote Git repository.

  3. Once your changes have been reverted, you can pull them in the Appsmith app to deploy the changes.

See also