Skip to main content

Reset

git reset command can be used for undoing changes, it is considered to be dangerous, but if you know how to use it, it can be really useful. So let's see how to use this command. If you've read Git basic Three Trees workflow section of this book you should not have any problems understanding explanation that will follow because of how git reset command work is closely tied with git basic three trees. So if you haven't read the above-mentioned section please read it before proceeding with this section. Ok so let's dive in.

There are three main forms of git reset command:

  • mixed

  • soft

  • hard