Re: Revert git push
From: Markus Korber <hidden>
Date: 2016-06-15 22:44:04
Thus spake Jonathan del Strother:
On Jan 10, 2008 1:15 PM, Markus Korber [off-list ref] wrote:quoted
I've got two local git repositories, linux and mplayer, where I push to from a local directory. Now I accidentally pushed from mplayer into the linux repository (via a not updated URL[1]). Is it somehow possible to revert this push if nobody has pushed something since my last pull from the linux repository?You can push again to revert your original push, just specifying a different ref to push. Something like this ought to work : git push -f mplayer 94545bade:master which will update the remote 'master' branch with commit 94545bade, which is what it was before your accidental push
Unfortunately this gives: ,----[ git push -f mplayer 94545bade:master ] | error: src refspec 94545bade does not match any. | fatal: The remote end hung up unexpectedly | error: failed to push to '/prj/gitroot/linux' `---- ,----[ git --version ] | git version 1.5.3.1 `---- Regards, Markus Korber