implement "commit" and "revert(checkout)" to a version