Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Recover deleted ipython/jupyter notebook?

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?

like image 843
Tommi Avatar asked Feb 12 '16 20:02

Tommi


1 Answers

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!
like image 113
Hasan Jamshaid Avatar answered Oct 21 '22 22:10

Hasan Jamshaid