I recently made some unnecessary changes to my existing code and accidentally deleted my controller (Using rails). At this point I was on my master branch since I just had to make a small change. Hence I had committed the changes to my repository.
To revert this, I use git reset --hard HEAD to get back to my old code. What I want to do now is remove the 2 commits ahead of this version and want to start working only on the head I just moved to. How do I go about this?