Here are some ways to reset your commit in GitHub:
- If you haven’t pushed the commit yet:
Run the following command in your terminal:
git reset --soft HEAD~
This will undo the last commit and keep the changes in your working directory.You can then make a new commit with the correct changes.
- If you’ve already pushed the commit:
You can use the git revert command to create a new commit that reverses the changes made in the original commit.
To do this, run the following command in your terminal:
git revert <e3222d33263dd7d35eafc920b710f9a931ec022a>

I’m Abhishek, a DevOps, SRE, DevSecOps, and Cloud expert with a passion for sharing knowledge and real-world experiences. I’ve had the opportunity to work with Cotocus and continue to contribute to multiple platforms where I share insights across different domains:
-
DevOps School – Tech blogs and tutorials
-
Holiday Landmark – Travel stories and guides
-
Stocks Mantra – Stock market strategies and tips
-
My Medic Plus – Health and fitness guidance
-
TrueReviewNow – Honest product reviews
-
Wizbrand – SEO and digital tools for businesses
I’m also exploring the fascinating world of Quantum Computing.