Remove two unused vars, pre-select master branch if exists, add first undo attempt