Curious Minds

Clear answers to science and history questions

Reverting Meaning & How to Use It

· 4 min read · Science

Reverting means restoring something to a previous state or condition. In everyday speech you might revert a phone to factory settings, while in law a court can revert a ruling to an earlier precedent. The verb derives from the Latin *revertere*, meaning “to turn back.”

Reverting in Software Version Control

Version‑control systems record each change as a distinct commit, making it possible to roll back to any earlier commit. To revert safely, identify the commit hash with git log, then run git revert <hash> which creates a new commit that undoes the selected changes without rewriting history. This approach preserves the audit trail and avoids conflicts that arise from git reset --hard.

Mercurial uses hg backout <revision> to achieve the same effect, while Subversion relies on svn merge -c -<revision> . followed by a commit. All three commands generate a forward‑only reversal, meaning the repository never loses the original commit data. The reversal can be inspected with git show, hg diff, or svn diff before committing.

SystemRevert CommandResult Type
Gitgit revert <hash>New commit that undoes changes
Mercurialhg backout <rev>New changeset that negates target
Subversionsvn merge -c -<rev> .Local modification ready to commit

Reverting a Document or File Manually

Most operating systems keep automatic snapshots that can be used to revert a file. On Windows, right‑click a file, select "Properties," then the "Previous Versions" tab to view snapshots taken by System Restore; choose a version no older than 24 hours for minimal data loss. On macOS, open the file in Finder, press Space to preview, then click the clock icon to access Time Machine snapshots taken at hourly intervals.

When a manual backup exists, copy the backup over the current file, preserving the original file’s permissions with chmod --reference=original backup on Linux. Always verify the checksum (e.g., sha256sum) of both files before overwriting to ensure integrity. After replacement, open the file in its native application and confirm that the expected content appears.

Courts may issue a reversal when a higher tribunal finds that the lower court misapplied precedent. The procedural step is to file a notice of appeal within 30 days of the judgment; the appellate court then issues a written opinion that either affirms, modifies, or reverts the original ruling. A reversal does not erase the lower decision; it creates a new binding precedent that supersedes the earlier one.

Administrative agencies follow a similar pattern: a new rule can revert a prior regulation by publishing a final rule in the Federal Register, typically providing a 60‑day comment period. Stakeholders should track the docket number and read the "Effective Date" line, which indicates when the revert takes legal force. Failure to comply after the effective date can result in enforcement actions.

How to Revert a Transaction in Banking or Payments

Most banks allow a reversal of a debit within 24 hours of posting. To initiate, call the bank’s customer‑service line, provide the transaction ID, and request a "charge‑back" or "transaction reversal." The bank will place a temporary hold of up to $5,000 for 48 hours while it verifies the request; if approved, the funds reappear in the account within one business day.

Credit‑card processors require a merchant‑initiated reversal within 7 days of settlement. The merchant must log into the payment gateway, locate the transaction, and select "Void" if the settlement has not yet occurred, or "Refund" if it has. A void cancels the authorization instantly, whereas a refund posts a credit that can take 3–5 business days to settle on the cardholder’s statement.

When Not to Use Revert and Alternatives

Reverting is inappropriate when the change introduced a critical security patch. In that case, the safer alternative is to apply a selective rollback: extract only the non‑security files from the backup and leave the patched binaries untouched. This preserves the security improvement while restoring functionality.

Another scenario is when a database migration fails. Instead of a full revert, perform a point‑in‑time recovery using transaction logs. Identify the exact timestamp before the migration, then run pg_restore --target-time="2023-07-15 14:30:00" for PostgreSQL. This method avoids losing data entered after the migration but before the failure.

Common Pitfalls and How to Fix Them

One frequent error is reverting a merge commit without first creating a backup branch. To avoid losing the merged work, run git branch backup‑before‑revert before executing git revert -m 1 <merge‑hash>. If conflicts arise, resolve them using git mergetool and complete the revert with git commit.

Another pitfall is assuming that a file‑system snapshot automatically restores permissions. After restoring a snapshot on Linux, run restorecon -R /path/to/dir to reset SELinux contexts, and verify ownership with ls -l. Ignoring these steps can cause services to fail to start because of denied access.

Tools and Interfaces That Support Reverting

Graphical interfaces often provide a one‑click revert button. In GitHub Desktop, select the commit, click "Revert this commit," and the app creates a new commit on the current branch. In Atlassian Bitbucket, the "Revert" option appears in the commit dropdown menu and automatically opens a pull‑request for review.

Command‑line utilities such as rclone support revert for cloud storage. After a sync, run rclone copy src:bucket dest:bucket --dry-run to preview changes, then use rclone sync --delete-excluded dest:bucket src:bucket to roll back any accidental deletions. Always test with --dry-run first to avoid irreversible data loss.

In this article
  1. Reverting in Software Version Control
  2. Reverting a Document or File Manually
  3. Reverting a Legal Decision or Policy
  4. How to Revert a Transaction in Banking or Payments
  5. When Not to Use Revert and Alternatives
  6. Common Pitfalls and How to Fix Them
  7. Tools and Interfaces That Support Reverting