implementation of discard changes for git