Reset a playground book in Swift Playgrounds on Mac
In some playground books in Swift Playgrounds, you can reset changes you’ve made, all the way back to the starting point. This is especially useful if you want to retry a challenge you already completed or let a friend try it. You can reset the current page or all the pages in a playground.
Note: In a playground book created with the File > New Book command in the My Playgrounds window, you can’t reset changes. You can create another blank playground by going to the My Playgrounds window, choosing File > New Book, and then renaming the new playground. See Use and create playground books.
Reset a page in a playground book
Resetting a page removes the code changes you’ve made on the page and returns the page to its original state. In a playground that supports user modules, resetting a page resets the code in the Main Swift file on the current page (in the tab with at the top) but doesn’t reset the shared Swift files in the playground.
In the Swift Playgrounds app on your Mac, go to the page you want to reset, then choose File > Start Page Over. (If you don’t see Start Page Over, the playground book was created with the File > New Book command and can’t be reset.)
Reset a playground book
Resetting a playground book removes the code, images, and files you’ve added and returns the playground to its original state. In a playground book that supports user modules, resetting it also removes modules and files you’ve added as well as the code changes you’ve made to any of the Swift files that came with it.
In the Swift Playgrounds app on your Mac, choose Window > My Playgrounds.
Control-click the playground book you want to reset, then choose Reset. (If you don’t see Reset, the playground book was created with the File > New Book command and can’t be reset.)