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

git undo # last command

From
STSaša Tomić <tomic80@gmail.com>
Date
Aug 16, 2013, 08:55 UTC
Message-ID
<CAAUyY9ADW2iHVWhTGcTF8j0hrdumpBcLv_mLo0y8VDAyBpftJQ@mail.gmail.com>
Hi to all,

I've been using git for some time now, but I'm in no way a git expert. I typically hack my way through the variety of commands that git provides. I believe that most git users work similarly.

it just occurred to me -- the command that I would REALLY like to have is simple:

  git undo

which 'undo'es the last action that has not been pushed yet -- whichever the action is. Similarly to the 'back' button in the browser.

Currently, when I make a mistake, I have to search the net to find the *right* command that will undo my last action/command. That's boring and time consuming. git undo would make things much easier, I believe.

Would creating such command be possible? I guess that 'behind the scenes', the command could analyze the reflog and act based on that.

What do you think?
-- 
Best regards,
Saša
Next: Jeff King
Message 1 of 4 in “git undo # last command”
  1. Saša TomićAug 16, 2013
  2. Jeff KingAug 16, 2013
  3. Saša TomićAug 16, 2013
  4. Fredrik GustafssonAug 16, 2013

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.