How to Revert to a Previous Commit in Github
Reverting to a previous commit in GitHub can be done using the Git command line. Here’s how to do it:
- 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.
This website uses cookies to ensure you get the best experience on our website. Learn More
Got it