Completely override previous git commit

My colleague threw an error into our git repository. I want to commit some updated code, but I did not execute git, and as a result I committed 1 for HEAD. How can I completely ignore his changes and override his error if I'm behind?

+5
source share
2 answers

I think you mean that he pressed a bad fix on the central repo.

If so, you can push your version with git push -f, and this will override the repository. Of course, this will also ruin the story ( fmeaning strength), so your colleague (s) will have to re-clone the central repo.

+6
source

, , , git revert , . :

git pull
git revert <treeish naming his commit>
git push
+8

All Articles