git revert back to certain commit [duplicate]

Question

how do i revert all my files on my local copy back to a certain commit?

commit 4a155e5b3b4548f5f8139b5210b9bb477fa549de
Author: John Doe <D[email protected]>
Date:   Thu Jul 21 20:51:38 2011 -0500

This is the commit i'd like to revert back to. any help would be a lifesaver!

Answer

git reset --hard 4a155e5 Will move the HEAD back to where you want to be. There may be other references ahead of that time that you would need to remove if you don't want anything to point to the history you just deleted.

git push says "everything up-to-date" even though I have local changes

How can I move HEAD back to a previous location? (Detached head) & Undo commits