14

I accidentally deleted an ipython notebook (.ipnyb) when I meant to delete an untitled notebook and didn't realize the other notebook was selected. Has anyone ever been able to recover a deleted notebook?

Tommi
  • 149
  • 1
  • 6
  • Were you able to figure out a solution to this? I also just accidentally deleted a file. – Collective Action Apr 11 '16 at 16:56
  • You might try an OS specific file undelete process. But that assumes you don't use the machine enough in the meantime to reallocate the freed sectors. Might be good to install an undelete solution now for the future. – volante Aug 09 '20 at 17:33

3 Answers3

3

Hope you've already found how to recover lost work from Jupyter notebook work. If not, try the following:

Go to Anaconda Navigator (or go to step 3 for Visual Studio Code).

  1. Launch a Jupyter Lab
  2. In Jupyter Lab, open a Terminal window
  3. Launch iPython in the terminal by typing ipython and hitting enter
  4. Run "%history -g"
  5. All your codes are stored in history and each cell compilation that you would've done in the past shows up there.
  6. Copy+Paste it back to a new Jupyter notebook and you are ready to go again!
Hasan Jamshaid
  • 1,659
  • 1
  • 11
  • 14
1

Checkpoints are deleted with the file. Try searching your browser's cache for the file: https://stackoverflow.com/a/44044643/1059398

virtualxtc
  • 390
  • 4
  • 21
0

Have a look at the sub-folder called .ipynb_checkpoints in the folder where you save the ipynb file, sometimes jupyter will save a copy of current ipynb file under that folder. And if you are lucky enough, you would get it back.

kingbase
  • 1,268
  • 14
  • 23