diff --git a/src/workflow/ArcanistLandWorkflow.php b/src/workflow/ArcanistLandWorkflow.php index 772233a4..0839aaf8 100644 --- a/src/workflow/ArcanistLandWorkflow.php +++ b/src/workflow/ArcanistLandWorkflow.php @@ -762,6 +762,12 @@ EOTEXT if ($err) { echo phutil_console_format("** PUSH FAILED! **\n"); + if ($this->isGit) { + $repository_api->execxLocal('reset --hard HEAD^'); + $this->restoreBranch(); + throw new ArcanistUsageException( + "'{$cmd}' failed! Fix the error and run 'arc land' again."); + } throw new ArcanistUsageException( "'{$cmd}' failed! Fix the error and push this change manually."); }