git-gui: Refactor the revert (aka checkout-index) implementation.