2

I'm a complete noob. I was told to play around on my research machine to try and learn some stuff. But I think I might have accidentally deleted important old code...

I opened up Notepad++ to see what it was. Selected all and backspaced, because I was going to try practicing code. Then instead of pressing CTRL+Y to undo, I clicked X, figuring it would prompt me to save the file, but it didn't. So I reopened the program and lo and behold, what I deleted was still deleted... But now I can't undo since I closed the program.

Is there any way I can possibly recover an older version of that file? I am brand new and don't have much experience coding so I am scared shitless to ask my research advisor.

EDIT: The file was called "change.log". Is that by any chance a default kind of file that displays program updates? Because at least if I deleted that kind of file it's not really important.

q-compute
  • 641
  • 2
  • 7
  • 15
  • Are you using windows? – Matt Cremeens Jun 03 '16 at 16:52
  • @MattCremeens, notepad++ means windows. – CroCo Jun 03 '16 at 16:54
  • 4
    first rule of being a newb: Never be afraid to ask your advisor. Not asking is the biggest mistake you can make. She/he will notice anyways whether you're already used to all this or not. Just go over there, and ask. Usually, no, there's no way back, once you've deleted the contents of a file, they're gone. However, it's likely you research team has code versioning and or backups, and this takes seconds to restore. But you don't mention any of that, so GO OUT THERE AND ASK RIGHT NOW :) – Marcus Müller Jun 03 '16 at 16:54
  • you can try seeing : http://stackoverflow.com/questions/21712139/notepad-how-to-recover-a-deleted-file or http://stackoverflow.com/questions/24158616/lost-code-lines-when-notepad-crashed though I also support the option of sharing this with your advisor... – nits.kk Jun 03 '16 at 16:54
  • Try right-clicking the file icon (not the shortcut on your desktop if you have one, but the actual file), select 'Properties' and then click 'Previous Versions' and see if anything shows up. – Matt Cremeens Jun 03 '16 at 16:55
  • @CroCo OP didn't hit "ctrl-x", he clicked the "x" button to close the window. Read closely. – Marcus Müller Jun 03 '16 at 16:58
  • The file was called change.log. Before I ask my advisor, is that any kind of default file? Like changes to the program updates? Or actually like a log of changes my team made? At least if I didn't delete something important that would be good... – q-compute Jun 03 '16 at 16:59
  • ask your advisor. Now. Any file is important, if in doubt. – Marcus Müller Jun 03 '16 at 17:00
  • turned my comment into an answer, so you really can see how serious I, and people like @nits.kk are about this. – Marcus Müller Jun 03 '16 at 17:01
  • op, imagine you never told anyone about that file being empty or you replacing it with something else, and someone finds out in six months. Imagine how pissed they will be. Talk about this now. It's probably not a big thing now, but it might become one! – Marcus Müller Jun 03 '16 at 17:02
  • @user6420521 are you alright? what happened? – Marcus Müller Jun 04 '16 at 09:23
  • As per @Tin-Tran's answer, change.log was just a file that contained information on Notepad++, so nothing important. I right-clicked the title of the tab and was able to recover what was in it pretty easily. But if that happens again I'll sure ask my advisor. – q-compute Jun 06 '16 at 03:53

3 Answers3

2

My comment got massive positive reaction, so here it is as an answer:

The first rule of being a newb is: Never be afraid to ask your advisor.

Not asking is the biggest mistake you can make. She/he will notice anyways whether you're already used to all this or not.

Just go over there, and ask. Usually, no, there's no way back, once you've deleted the contents of a file, they're gone. However, it's likely your research team has code versioning and/or backups, and this takes seconds to restore. But you don't mention any of that, so GO OUT THERE AND ASK RIGHT NOW.

Marcus Müller
  • 34,677
  • 4
  • 53
  • 94
0

In Notepad ++ if you close the program everything stays as is next time you open it up so it doesn't prompt for you to save the file... Only when you try to close the file (not the program) does it try to prompt you for saving the file.

If you closed the program only and didn't actually save the file, it should be as simple as trying to close the file and then answer No to saving and reopening it again.

UPDATE: change.log just defaults to open whenever you first run NotePad++ the first time, it is to tell you changes of NotePadd++ versions. I usually just close it and ignore it as i don't really need it.

Tin Tran
  • 6,194
  • 3
  • 19
  • 34
0

I don't think you said this file was on actually on your research machine. But if it was locally, it's probably there because of this reason. So you can research and play around with it. It could be likely this file was pulled down from some file repository like Git, svn, or tfs.

If that's not the case, it's hard to say if it's recoverable with the little information that we know. Like Marcus said, go inform you advisor, and you might find out that you'll just repull the file from the repository which would take seconds.

In any event, these things happen to everyone at all skill levels and your advisor should understand. There would be more repercussions if you are spending all your time finding a deleted file, rather than researching and working on practical business needs.

Fus Ro Dah
  • 331
  • 5
  • 22