FahamLah

Commands

git reset

git reset [--soft | --mixed | --hard] <commit>

Risk: Careful

What it does

Moves your branch back to an older commit.

When to use it

Only for commits you have not shared yet.

Example

$ git reset --soft HEAD~1

Undo the last commit. Changes stay in the box.

$ git reset HEAD~1

Changes go back to your folder.

$ git reset --hard HEAD~1

Changes are wiped. Danger!