How to Revert to a Previous Commit in Github
- George Apostolov
- 05 Sep 2025
Guide
Go to your repository on Github and click on the 'Commits' link.
You will be directed to the commit history and click on the clipboard icon to copy the unique ID of the commit you want to revert.
Go to the visual studio code, open up a terminal and type 'git revert' and past the unique ID or if it's a merge commit type m1 and paste the hash.
It creates a new commit that undoes the changes introduced by a specific commit. Your history remains intact.
By following these steps, you can easily revert a previous commit.
Create your first interactive demo in minutes
No credit card required • Start building today


