Skip to content

How do you revert someone's commit? #4

Answered by ApolloZhu
AppDevUW asked this question in Q&A
Discussion options

You must be logged in to vote

There are several ways you could do this:

1. Revert but keep it in history

Let's say you'd like to revert commit 9fb4114d "fix casing" (even if you didn't author it), you can do:

git revert 9fb4114d

... and all the changes introduced in commit 9fb4114d will be reverted:

If you use git GUI, most applications provide an option to revert a commit (likely in the right click menu).


! IMPORTANT NOTICE

For the following 2 options, you might need to force push to the server if the commits you are changing is already on the server. Make sure others are aware of the force push so they can make necessary adjustments/updates.

2. Rewrite history

Interactive rebase is more advanced, but you could a…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ApolloZhu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
2 participants