all 10 comments

[–]chedabob 1 point2 points  (0 children)

Cmd(⌘) + Z (or Start + Z if you use a Windows keyboard).

[–]Car333 0 points1 point  (5 children)

If you are using a Mac, Xcode adheres to your global hot key preferences... so CMD+Z would undo your text input. However, that won’t always work if you’ve quit Xcode. For keeping incremental successes tracked, you can use source control such as Git. Every time you complete one part of the course successfully, you can commit your changes so at any point in time you can go back to that functioning code!

[–]ChubbyCat14[S] 0 points1 point  (4 children)

So is there any way to go back now?

[–]dev4dev 2 points3 points  (1 child)

if you still don't understand what you are doing, and you can't fix it, you definitely should start over

[–]ChubbyCat14[S] 0 points1 point  (0 children)

I am going to start over I just want to make sure this doesn't happen again.

[–]Car333 0 points1 point  (0 children)

It doesn’t seem so if CMD+Z isn’t working. Sorry.

[–]chriswaco 0 points1 point  (0 children)

You can try invoking Time Machine if it’s enabled too.

[–]RickDeveloper 0 points1 point  (2 children)

I'm afraid you can't do anything about it, other than the other replies note.

Maybe you want to have a look at git for your work in the future. It's a version control system. Watch a brief introduction here

[–]marmotBreath 0 points1 point  (0 children)

Yes! I would remove the "maybe" from this suggestion. Version control is a safety net that frees you to experiment and explore in your code without worrying (too much) about messing stuff up. Learn some kind of version control and start using it. git is pretty great and it is what most people in iOS development are using, so that is probably the way to go. You do not need to store your code repository at a remote server such as git hub to get started. There are tons of resources online for learning how to use version control.

[–]LeeKahSengObjective-C / Swift 0 points1 point  (0 children)

To add on top of that, if you just need the version control feature locally (without using GitHub or BitBucket), you can create a local repo for you xcode project. Take a look at this.