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

Re: local mistake - need help in recover

From
D. Ben Knoble <ben.knoble@gmail.com>
Date
Jul 14, 2026, 22:27 UTC
Message-ID
<CALnO6CBFSY9Zj34q-P9NQwvMrJiPzS9caP2qjB5KCW3aQYz0hg@mail.gmail.com>
In-Reply-To
<MA0PR01MB9857F8757F67BD2F8FF358CF97F92@MA0PR01MB9857.INDPRD01.PROD.OUTLOOK.COM>
Show 6 quoted lines
> Le 14 juil. 2026 à 00:06, N.S Kishore <n.s.kishore@cctech.co.in> a écrit :
> 
> Hi Team,
> Need help to recover files from local mistake.
> Regards,
> Kishore N S.
> After merge (and/or related operations in the same session), staged files disappeared from the index
I could only slightly reproduce the issue reported:
    git init foo && cd foo
    echo a >a && git add a && git commit -ma
    echo a >>a && git commit -am aa
    git switch -c b HEAD~
    echo b >b && git add b && git commit -mb
    echo b >>b && git add b
    echo b >>b

From here, « git merge main » refuses (« Your local changes to the following files would be overwritten by merge »). With autostash mode, the merge succeeds, but the staged line of b is now unstaged. The working tree contents were not lost, though.

In retrospect, I didn’t try with new files on the side branch.

Test performed with Git 2.53.0 and repeated with 2.55.0.rc0.738.g0c8ab3ebcc.dirty.

Previous: N.S Kishore
Message 2 of 2 in “local mistake - need help in recover”
  1. N.S KishoreJul 14, 2026
  2. D. Ben KnobleJul 14, 2026

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.