Re: Revert git push

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Jan 10, 2008 1:15 PM, Markus Korber <korbse@xxxxxx> wrote:
> 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?
>
> (Or can I just copy the .git/objects/ directory over to the repository?)
>
> ,----[ .git/remotes/mplayer [1]]
> | URL: /prj/gitroot/linux
> | Push: +master:master
> `----
>
> ,----[ git push mplayer ]
> | updating 'refs/heads/master'
> |   from 94545baded0bfbabdc30a3a4cb48b3db479dd6ef
> |   to   9085d919f7954ad629447157f054e55230513936
> | Generating pack...
> | Done counting 3240 objects.
> | Deltifying 3240 objects...
> |  100% (3240/3240) done
> | Writing 3240 objects...
> |  100% (3240/3240) done
> | Total 3240 (delta 774), reused 0 (delta 0)
> | refs/heads/master: 94545baded0bfbabdc30a3a4cb48b3db479dd6ef -> 9085d919f7954ad629447157f054e55230513936
> `----


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

Jon
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux