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

Re: Revert git push

From
Johannes Sixt <j.sixt@viscovery.net>
Date
Jan 10, 2008, 14:12 UTC
Message-ID
<478627E2.4060808@viscovery.net>
In-Reply-To
<6zve61q0t3.fsf@odpc25.int.ondemand.co.at>
Markus Korber schrieb:
Show 7 quoted lines
> Hi,
> 
> 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?
Sure.

$ cd /the/linux/repo $ git checkout 94545baded $ git branch -f master 94545baded $ git checkout master

Omit the two checkouts if the repo is bare or if it did not have 'master' checked out.

-- Hannes
Previous: Markus KorberNext: Markus Korber
Message 4 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.