Git workflow => modified, staged, comitted

Hey guys!
It’s my second day of learning git and I have some question about git workflow.
so we have 3 steps in git

  • modified or unstaged
  • staged
  • committed
    Say when you are working on a project and you have an old laptop. When your computer shutdowns automatically what happens when your modified project/files is in the first or second place. I mean the unstaged or staged time.
    or if you close the cmd accidentally what happens to your changes ?

I’d say their are 4 steps

  • modified or unstaged
  • staged
  • committed
  • pushed to remote

If you turn off your laptop in stages 1-3, nothing changes in the remote and your code stays in that stage locally.

1 Like

They say the only reason you wanna learn git is because of " snapshots in time " or " saving point in time " like in games. So the tutorial shows how to see and access those copies including ’ original file ’ that I started with.
Is the third step ( committed step ) where it all saves and that’s what makes learning git important?
I mean do I get it right?

A “snapshot in time” isn’t the only reason to use a version control system, but it’s the one you’re most likely to care about if you’re working alone. The commits are those “snapshots” that you can look back on.