fix discardAllChanges and unstage