Clearing master and switching branch