How do you get back what you deleted on codepen

I deleted my code by mistake, but i had saved major chunk of it earlier. Is there any way to get my code back?

1 Like

Sometimes you can ctrl-Z.

1 Like

I think, so long as you haven’t left the page, you should be able to ctrl z and get your code back. If you’re having trouble getting it to work click inside the section of the page that you’re trying to undo. For example, you’ve accidentally deleted some of your css code. Click inside the css box and try ctrl z. Other than that, so long as you saved before deleting anything, you should be able to open the pen again, preferably in a new tab in case it didn’t work, and pick up where you left off.

1 Like

sadly, I left the page, hoping that the autosave wouldn’t have refreshed. Anyway, Thanks a lot! i’m sure it is going to benefit me in future @ChadKreutzer and @EternalLocket

I like to look at things in a glass half-full sort of way. So when something like that happens to me I just think: at least repetition helps Concepts solidify in my brain. :slight_smile:

1 Like

hahah! yes exactly! optimistic! Surely I’m going to improve the page this time!


I’m sure you will! Be sure to share it with us when you finish.

Oh man…I did the same thing @aneesh987. Overwrote the contents of the quote project with the weather app. I think I’ll change my workflow to editing locally and pushing to github to keep changes, and pasting into CodePen to render. That way any blunders can be easily fixed as opposed to redoing entire projects.

What’s everyone else’s workflow look like? Straight up CodePen?

1 Like

Happened to me sometime ago too. Since then, everything I do is done locally and after any significant (or not so much) code change I just commit it to GitHub. Saves a lot of problems and gets me into the habit of using version control.


Thanks. That helped.

Cut out CodePen entirely for any projects larger than “I wanna try something out to see how it looks”.

If you want live preview, some text editors (such as Brackets) have that functionality. Or you can just open your local index.html file in your browser and refresh whenever you want to see the changes.

Thank You…that solved it for me.