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 >>bFrom 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.