There's a Playground Mode in Colab (check File menu), it still allows you to run and change everything but nothing will be saved, that applies to output too. You can also create links to Playground mode Colab Notebooks yourself by appending #forceEdit=true&sandboxMode=true to the URL, i.e colab.research.google.com/drive/1R4O...?hl=en#forceEdit=true&sandboxMode=true  and perhaps collect those links into single Notebook and access those files from there.
But even if you accidentally do mess up your Notebook, in most cases you can still roll back to pervious revision through Revision history , you can name revisions and manually save & pin your Notebook.
Colab also integrates with Github and you can conveniently save the copy there as well for proper version control - File >> Save a Copy in Github
Works with private repositories and Github Gists too. And by default the "Open In Colab"  button is added to those files, so no need to manually re-import anything to Colab or GDrive.
I want to save my codes and i want to restrict it that no one can change it even myself.
I don't know how to do it. is it possible?
I know how to share without edit permission. but how to do it for myself
how can i save the codes in colab and it's permissions