marcandrewb
2/11/2016 - 6:08 PM

Git Notes

Git Notes

There are 3 types of reset available in git. A reset allows you to return to a particular version in git history.

git reset --hard {{some-commit-hash}} – Return to a particular point in history. All changes made after this commit are discarded.
git reset {{some-commit-hash}} – Return to a particular point in history. All changes made after this commit are moved “not yet staged for commit” stage. Meaning you would have to run git add . and git commit to add them back in.
git reset --soft {{some-commit-hash}} – Return to a particular point in history. All changes made after this commit are moved to “staged for commit” stage. Meaning you only need to run git commit to add them back in.