I think a more reliable workflow (mirroring what we use on the server) would be:
```ruby
git("fetch --all")
begin
  git("reset --hard mortar/#{branch}")
rescue Exception => e
  err_msg = e.to_s
  if err_msg.include?("unknown revision or path")
    git("reset --hard HEAD")
    git("checkout -b #{branch}")
  else
    raise e
  end
end```