Hero Image

Reverting git

Reverting your local file(s) to the original.

Assuming you did not commit the file, or add it to the index:

git checkout -- filename

Assuming you did add it to the index, but did not commit:

git reset HEAD filename
git checkout -- filename

Assuming you did commit:

git checkout origin/master filename

Assuming you want to wipe all your local commits and reset to a fresh master copy:

git reset --hard origin/master