commit validator: restore head commit after its operation
commit tester: restore branch correctly

If commit tester is executed when HEAD was a branch,
then restore to the branch itself rather than to the commit.