Categories

Oct 15, 2019 in Git

Q: In Git how do you revert a commit that has already been pushed and made public?

1 Answer

Oct 15, 2019
There can be two approaches to tackle this question and make sure that you include both because any of the below options can be used depending on the situation:

Remove or fix the bad file in a new commit and then push it to the remote repository. This is the most obvious way to fix an error. Once you have made necessary changes to the file, then commit it to the remote repository using the command: git commit -m “commit message”

Also, you can create a new commit that undoes all changes that were made in the bad commit. To do this use the command

git revert <name of bad commit>
Click here to read more about GIT
Click here to read more about Insurance

Related questions

Madanswer
Oct 16, 2019 in Git
Apr 18 in Git Slack Integration
Feb 17 in Git
...