git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Revert git push

From
MKMarkus Korber <korbse@gmx.at>
Date
Jan 10, 2008, 13:45 UTC
Message-ID
<6zmyrdpze7.fsf@odpc25.int.ondemand.co.at>
In-Reply-To
<57518fd10801100531v6f6aef85k4b1b875c6f16aeba@mail.gmail.com>
Thus spake Jonathan del Strother:
Show 15 quoted lines
> On Jan 10, 2008 1:15 PM, Markus Korber <korbse@gmx.at> wrote:
>
>> 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

Previous: Jonathan del StrotherNext: Johannes Sixt
Message 3 of 5 in “Revert git push”
  1. Markus KorberJan 10, 2008
  2. Jonathan del StrotherJan 10, 2008
  3. Markus KorberJan 10, 2008
  4. Johannes SixtJan 10, 2008
  5. Markus KorberJan 14, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.