0

I was working in a branch say abc with uncommitted changes, then I tried to checkout to the other branch say xyz, there were conflicts so I opted for smart merge(using git in intellij idea). Midway through resolving, i accidentally clicked on abort and it checked out into the new brach xyz and the changes from abc branch were gone. When I checked out into abc again, I still couldn't find those changes. Is there a way to recover those lost changes?

  • You told IntelliJ (not Git) to throw out your work. IntelliJ told Git to throw out your work. Git took IntelliJ at its word here. IntelliJ may or may not have some way to recover, but Git does not. – torek Aug 04 '22 at 17:39
  • If you were resolving conflicts, then I assume you staged your files at some point? Staged, but uncommitted files [may be recoverable](https://stackoverflow.com/q/11094968/184546), but without filenames. – TTT Aug 04 '22 at 19:03
  • How did you get conflicts doing a checkout? From the uncommitted changes? If you have uncommitted changes on files that are _different_ between where you want to go and HEAD, git refuses to checkout. Can you show us the sequence of commands that you tried? Or replicate that scenario? – eftshift0 Aug 05 '22 at 08:22

0 Answers0