I have a few remotes, and an origin at github. I did several commits at one remote (A) that I pushed to origin but have not pulled to another remote (B).
I.e. Both remote A and origin are at C3:
C1->C2->C3
Remote B is at C1. I want everyone back at C1 so the commit chain looks like:
C1->C2->C3->C1
Now I want to revert everything to the state B is at (C3) using revert
. But to do that, I need the commit code or hash or whatever it is called. I tried git show-ref
and git for-each-ref
but they display some very long hash, not the short codes that I believe signify each commit, which I would use in revert?
How do I find that code for the latest local commit on B, so that I can use it for revert and then push to origin?
From what I understand, I should be able to do git fetch
at B to update my remote-tracking branch. And then I should be able to do a revert and push to origin, and then on my other remotes pull
to get everything on the same page. Right?