I'm working on my project in Sublime text. After reaching a milestone earlier, I committed my work to my local Git (didn't Push)
I continued working, and screwed up. Now I want to go back to my last commit and try again. So I Googled a bit and found the git revert --hard last-commit
which I entered in my command prompt and got this
HEAD is now at 5d6eebd Revert "Finished adding feature. Everything works"
But in my Sublime editor, my files haven't changed back. I tried closing and reopening the files but everything is still screwed up.
What's the point of reverting if it doesn't change my files back? Am I doing something wrong?
git revert
is for making a new commit that undoes the work of a previous commit (or range of commits).To get back to your last commit on the current branch, discarding all work done since then, try
git reset --hard HEAD
.