How can I fix a reverted git commit?

mmr picture mmr · Mar 18, 2011 · Viewed 25.9k times · Source

I've committed a bunch of changes to a repository, and they were reverted by someone else (they compile on windows but not on linux). I think that the changes are still in the history, but how can I get those changes back, fix them, and then resubmit?

Answer

Nils Werner picture Nils Werner · Mar 18, 2011

Have you tried reverting the revert?

They reverted your commit using

git revert <your commit id>

The revert itself is a commit and has its own commit id. So now you need to do

git revert <the commit id of his revert-commit>