Home > Software engineering >  Is there a way to retrieve a commit message being written after accidentally closing visual studio?
Is there a way to retrieve a commit message being written after accidentally closing visual studio?

Time:01-16

I was writing a rather long commit message and accidentally closed Visual Studio. Is there a way to recover it?

I would guess it can be done, since a fairly similar situation has already happened earlier today, with the same commit message: my computer restarted automatically and when the restart finished, I opened Visual Studio again and the commit message was here, waiting to be finished.

But this time, there was no restart; I closed the window and when I opened it again, the commit message was gone...

I tried looking in AppData/Local/Microsoft/VisualStudio/BackupFiles/ but it was empty.

I also tried looking in my solution's .git folder: I opened the file COMMIT_EDITMSG but did not find my commit message inside.

CodePudding user response:

I found it in my solution's .git folder, in a file named ms-persist.xml.

  • Related