How to presist the dataset and output file in colab?

I recently started using google colab for projects and everytime I exit the browser my dataset and output files are deleted in colab. Is there a way to save the dataset and files on google drive and not run the whole notebook again ?

That’s what the commit() method is for.

No idea if that’s what you mean. No notebook will keep the state of execution after it’s closed (even the local ones).