We just started using git in production at our company and everyone seems to have the same concern/issues. Since we are still getting the hang of using git, we frequently end up messing up our local repsitories. (bad merges, wrong commands, etc). What we want to do is reset our local repositories back to a given revision and get rid of all remnants of the bad changes.
I have been reading up on it, and I see how I can use 'git reset' with it's various options to move the head around and general get my working area back to the correct state, but I am unclear as to what this leaves in the respository and how to clean that up.
For example if I perform a bad merge in my local repository:
git checkout master git merge wrong_branch
I can reset in master to get back to the commit before that, but is the merge commit still sitting in the respository object database? Similarly, if it is sitting there and I push my branch to a remote repository, will it pass along the bad merge data?
It there some way to absolutely remote the bad merge commit (or any other bad revision) from my local repository to make sure I don't pollute the public repository with data that should be ignored as if it never happened?