Jump to content

Git Rollback & Revert Procedure


- Alex -

Recommended Posts

  • Community Leader

  • Member ID:  1
  • Group:  Community Leader
  • Followers:  11
  • Topic Count:  198
  • Topics Per Day:  0.06
  • Content Count:  495
  • Content Per Day:  0.15
  • Reputation:   36
  • Achievement Points:  4678
  • Solved Content:  0
  • Days Won:  36
  • Joined:  07/11/17
  • Status:  Offline
  • Last Seen:  
  • Device:  Windows

Git Rollback & Revert Procedure
Recovering from Bad Changes
This guide may be updated as GGU policies, procedures, platforms, and organizational needs change.

Use this guide when a deployed change must be reversed.

 

Prefer Revert for Shared History

When a bad commit is already shared, prefer creating a new revert commit rather than rewriting shared branch history.

 

Rollback Process

  1. Identify the exact change causing the problem.
  2. Stabilize production if immediate containment is needed.
  3. Revert or redeploy the last known-good version.
  4. Verify service health.
  5. Document the rollback.
  6. Open follow-up work for the underlying issue.
Force Push:
Do not force-push protected/shared branches to erase mistakes unless explicitly authorized for an exceptional recovery case.

 

Change Control

  • Know what you are changing and why.
  • Back up or ensure a rollback path for high-impact changes.
  • Avoid combining unrelated changes.
  • Record material production changes.
  • Test before production when practical.

 

Validation

  • Confirm the service starts successfully.
  • Review logs for new errors.
  • Test the exact behavior changed.
  • Confirm permissions and integrations still work.
  • Monitor briefly after deployment for delayed failures.

 

Escalation

If a change affects systems outside your responsibility, creates a security concern, or cannot be safely reversed, stop and escalate rather than continuing to experiment in production.

 

Database Changes

Code rollback may not reverse database migrations. Identify database rollback or compatibility requirements before deploying schema changes.

 

Prerequisites

  • Confirm you are authorized to make the change.
  • Confirm the target system/server/repository.
  • Read current project or service documentation.
  • Identify the expected result.
  • Identify a rollback or recovery path for high-impact work.

 

Common Mistakes to Avoid

  • Copying commands or values from a different server without checking context.
  • Making several unrelated changes before testing.
  • Ignoring warnings because the service still appears to start.
  • Editing production directly when a safer test or review path exists.
  • Deleting old files or backups before the replacement is verified.
  • Treating permissions errors as a reason to grant broad administrator access.
  • Failing to record what changed.

 

Operational Record

For material changes, record enough information for another administrator to understand the target, change, reason, result, and rollback point. This may be a ticket, issue, pull request, deployment note, incident record, or appropriate Leadership message.

 

If Something Goes Wrong

  1. Stop making unrelated changes.
  2. Preserve the current logs and error output.
  3. Determine whether immediate rollback is safer than continued troubleshooting.
  4. Restore the last known-good state where practical.
  5. Escalate with the exact error, target service, recent changes, and reproduction steps.
  6. After recovery, document the cause and any preventative follow-up.

 

Restore service first, then fix the root cause.

Alex Thunderhunter

Alex — Founder & Systems Architect

Building the community, one server at a time.

Community Leader
Link to comment
Share on other sites


  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.