Sublime Forum

My changes disappeared - work lost!

#1

After making some changes to my files I was going through the process of selecting hunks and then making commits, when I discovered some of my changes had been thrown away!

Luckily I had a backup and knew which changes had been lost so I could recover them, but I’m very disappointed that it’s possible to lose work silently using SublimeMerge.

What happened was I realised I had made two commits (of different files) with the same description, so I wanted to revert the commits and make a single one instead. But during that process I noticed that the hunks I now wanted to commit had completely vanished from my source tree. How is this even possible? (And no, I didn’t double click on Discard Hunk)

0 Likes

#2

But during that process I noticed that the hunks I now wanted to commit had completely vanished from my source tree.

It is difficult for someone to tell you what you did wrong without you giving step by step of what you did. I would start by explaining the “process” that you went through, and maybe someone can look at that and explain what went wrong.

1 Like

#3

Similar to what facelessuser asked for, I’m wondering what specifically you did to revert the commits.

0 Likes

#4

Just a note that Sublime Merge stashes your changes when you press Ctrl+S, which incidentally is also what you press to save your changes in your text editor, so it’s easy to accidentally press this, have everything gone, and not knowing why. Of course, you can always restore the stash but first you’d have to know what happened.

I keep saying this, but Sublime Merge really needs some kind of safety net and makes it clearer what happened when changes are gone, with ideally a consistent way to undo it. Also a way to set Sublime Merge to safe mode where things like “Discard”, “Discard Hunk” and associated shortcuts are disabled.

0 Likes

#5

Thank you Laurent, that is a possible explanation.

Also part of the problem is that smerge has two Undo menus, one in Edit and one in Repository. Surely this is exceedingly poor user interface design?

0 Likes