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

RE: undoing something

From
JDJohn Dlugosz <jdlugosz@tradestation.com>
Date
Mar 16, 2009, 19:48 UTC
Message-ID
<450196A1AAAE4B42A00A8B27A59278E70A2AEFD7@EXCHANGE.trad.tradestation.com>
In-Reply-To
<7veiwxwa9z.fsf@gitster.siamese.dyndns.org>

=== Re: === The answer was best only because in your previous question you wanted to ensure fast-forwardness, i.e. "git push . origin/dev:dev" without plus in front to cause it to fail if it is not fast-forward. === end ===

No, I don't want to ensure ff. The remote may have been changed in other ways. Though in that case I will avoid doing so; when it is not the case it's even more important to see that your local copy is different, and understand the tree, rather than blindly pulling.

=== Re: === If you know you have one unwanted commit you would want to discard at the tip of topic, you do not want fast-foward safety to kick in.

 (1) if you are on the topic branch, you can say "git reset --hard
HEAD^";
     or
=== end ===

It was a rebase, so the old value is not under the current, or even visible on the tree. That's why I needed the reflog to find it. Tagging it let it appear in gitk.

=== Re: ===
 (2) if you are not, you can obviously check out topic and do the above,
     or "git branch -f topic topic^".
=== end ===

As documented, this destroys the existing branch and makes a new one. That would, by design, blow away the reflog for that branch. What I want is a way to re-point it, and record that repointing =in= the reflog. That is, a command-line version that does what I can do with the GUI, but isn't limited to what I can point to with the mouse.

--John (please excuse the footer, yadda yadda)

TradeStation Group, Inc. is a publicly-traded holding company (NASDAQ GS: TRAD) of three operating subsidiaries, TradeStation Securities, Inc. (Member NYSE, FINRA, SIPC and NFA), TradeStation Technologies, Inc., a trading software and subscription company, and TradeStation Europe Limited, a United Kingdom, FSA-authorized introducing brokerage firm. None of these companies provides trading or investment advice, recommendations or endorsements of any kind. The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited.
  If you received this in error, please contact the sender and delete the material from any computer.
Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 15 in “undoing something”
  1. John DlugoszMar 16, 2009
  2. Junio C HamanoMar 16, 2009
  3. John DlugoszMar 16, 2009
  4. Junio C HamanoMar 16, 2009
  5. Effective PostingJohn Dlugosz, Mar 16, 2009
  6. René ScharfeMar 16, 2009
  7. John DlugoszMar 16, 2009
  8. Jay SoffianMar 16, 2009
  9. John DlugoszMar 16, 2009
  10. (unknown)Nanako Shiraishi, Mar 16, 2009
  11. Junio C HamanoMar 17, 2009
  12. git-branch.txt: document -f correctlyMichael J Gruber, Mar 17, 2009
  13. Junio C HamanoMar 17, 2009
  14. Michael J GruberMar 17, 2009
  15. John DlugoszMar 17, 2009

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.