This interactive demo was created free with Storylane in 2 minutes. Create your own demo
This interactive demo was created free with Storylane in 2 minutes. Create your own demo
Start free
All Tutorials /GitHub

How to Revert a Commit in Github

Updated on:
May 12, 2026
By:
Madhav Bhandari
Use this interactive demo to learn how to safely undo a commit in your GitHub repository.

Quick summary

Reverting a commit in GitHub creates a new commit that undoes specific changes without rewriting your repository's history. This process is done entirely through the GitHub UI via the Pull Requests tab, making it safe for collaborative workflows.


Steps

  1. Go to your repository on GitHub.
  2. Select the Pull Requests tab from the repository navigation.
  3. Locate the pull request that contains the commit you want to revert.
  4. Click Revert to create a new commit that undoes the changes made by that specific commit.

📌 Why this matters

Knowing how to revert a commit in GitHub is an essential skill for any developer working in a collaborative codebase. GitHub's built-in Revert button allows teams to safely undo unwanted changes by creating a new commit, preserving the full commit history and avoiding the risks of destructive rewrites. This non-destructive approach keeps pull request workflows intact and ensures code integrity across branches. It is especially valuable when a merged pull request introduces bugs or unintended changes that need to be rolled back quickly.
Your product deserves an interactive demo
Start free
Similar Articles
GitHub

How to Import a Project from GitHub to Replit

Madhav Bhandari
Director of Marketing @ Storylane
GitHub

How to Push Code from Replit to GitHub

Madhav Bhandari
Director of Marketing @ Storylane
GitHub

How to Connect Replit to GitHub

Madhav Bhandari
Director of Marketing @ Storylane
No items found.
Platform
Interactive Demos
Sandbox Demos
Buyer Hub
RepX
Integrations
Solutions
Product Marketers
Growth & Demand Gen
Sales Reps & AEs
Presales & SEs
Customer Success
Product Managers
Customers
Demo Showcase
Customer Stories
Finer Demos Club
Features
Demo Signals
Personalization
Deal Intelligence
Resources
Blog
The Plot
Tutorials
Events & webinars
Help Docs
What’s New
Demo Dundies
Company
Careers
Pricing
Partners
Contact
Trust Center
Backed by
Chrome Extension Icon
Chrome extension
Download
Desktop app
Download
Built in San Francisco Bay Area - ©2026 Storylane
Privacy PolicyTerms & Conditions
X Corp (formerly Twitter)LinkedIn
This website uses cookies to ensure you get the best experience on our website. Learn More
Got it
This website uses cookies to ensure you get the best experience on our website. Learn More
Got it