(CommandList
  children: [
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:USAGE)
          op: Equal
          rhs: {(SQ <'[--mixed | --soft | --hard]  [<commit-ish>] [ [--] <paths>...]'>)}
          spids: [12]
        )
      ]
      spids: [12]
    )
    (Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(LhsName name:SUBDIRECTORY_OK) op:Equal rhs:{(Yes)} spids:[17])]
      spids: [17]
    )
    (C {(.)} {(git-sh-setup)})
    (C {(set_reflog_action)} {(DQ ('reset ') ($ VSub_Star '$*'))})
    (C {(require_work_tree)})
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair lhs:(LhsName name:update) op:Equal rhs:{(EmptyPart)} spids:[34])
        (assign_pair lhs:(LhsName name:reset_type) op:Equal rhs:{(--mixed)} spids:[36])
      ]
      spids: [34]
    )
    (C {(unset)} {(rev)})
    (While
      cond: [(C {(test)} {($ VSub_Pound '$#')} {(KW_Bang '!') (Lit_Other '=')} {(0)})]
      body: 
        (DoGroup
          children: [
            (Case
              to_match: {(DQ ($ VSub_Number '$1'))}
              arms: [
                (case_arm
                  pat_list: [{(--mixed)} {(--soft)} {(--hard)}]
                  action: [
                    (Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:reset_type)
                          op: Equal
                          rhs: {(DQ ($ VSub_Number '$1'))}
                          spids: [79]
                        )
                      ]
                      spids: [79]
                    )
                  ]
                  spids: [67 76 85 16777215]
                )
                (case_arm
                  pat_list: [{(--)}]
                  action: [(ControlFlow token:<ControlFlow_Break break>)]
                  spids: [88 89 95 16777215]
                )
                (case_arm
                  pat_list: [{(-) (Lit_Other '*')}]
                  action: [(C {(usage)})]
                  spids: [98 100 106 16777215]
                )
                (case_arm
                  pat_list: [{(Lit_Other '*')}]
                  action: [
                    (AndOr
                      ops: [Op_DPipe]
                      children: [
                        (Assignment
                          keyword: Assign_None
                          pairs: [
                            (assign_pair
                              lhs: (LhsName name:rev)
                              op: Equal
                              rhs: 
                                {
                                  (CommandSubPart
                                    command_list: 
                                      (CommandList
                                        children: [
                                          (C {(git)} {(rev-parse)} {(--verify)} 
                                            {(DQ ($ VSub_Number '$1'))}
                                          )
                                        ]
                                      )
                                    left_token: <Left_CommandSub '$('>
                                    spids: [114 124]
                                  )
                                }
                              spids: [113]
                            )
                          ]
                          spids: [113]
                        )
                        (ControlFlow token:<ControlFlow_Exit exit>)
                      ]
                    )
                    (C {(shift)})
                    (ControlFlow token:<ControlFlow_Break break>)
                  ]
                  spids: [109 110 137 16777215]
                )
              ]
              spids: [58 64 140]
            )
            (C {(shift)})
          ]
          spids: [55 145]
        )
    )
    (C {(Lit_Other ':')} 
      {
        (BracedVarSub
          token: <VSub_Name rev>
          suffix_op: (StringUnary op_id:VTest_Equals arg_word:{(HEAD)})
          spids: [150 154]
        )
      }
    )
    (AndOr
      ops: [Op_DPipe]
      children: [
        (Assignment
          keyword: Assign_None
          pairs: [
            (assign_pair
              lhs: (LhsName name:rev)
              op: Equal
              rhs: 
                {
                  (CommandSubPart
                    command_list: 
                      (CommandList
                        children: [
                          (C {(git)} {(rev-parse)} {(--verify)} 
                            {($ VSub_Name '$rev') (Lit_Other '^') (0)}
                          )
                        ]
                      )
                    left_token: <Left_CommandSub '$('>
                    spids: [157 167]
                  )
                }
              spids: [156]
            )
          ]
          spids: [156]
        )
        (ControlFlow token:<ControlFlow_Exit exit>)
      ]
    )
    (Case
      to_match: {(DQ ($ VSub_Number '$1'))}
      arms: [(case_arm pat_list:[{(--)}] action:[(C {(shift)})] spids:[185 186 190 16777215])]
      spids: [177 183 192]
    )
    (If
      arms: [
        (if_arm
          cond: [(C {(test)} {($ VSub_Pound '$#')} {(KW_Bang '!') (Lit_Other '=')} {(0)})]
          action: [
            (AndOr
              ops: [Op_DPipe]
              children: [
                (C {(test)} {(DQ ($ VSub_Name '$reset_type'))} {(Lit_Other '=')} {(DQ (--mixed))})
                (C {(die)} {(DQ ('Cannot do partial ') ($ VSub_Name '$reset_type') (' reset.'))})
              ]
            )
            (AndOr
              ops: [Op_DPipe]
              children: [
                (Pipeline
                  children: [
                    (C {(git)} {(diff-index)} {(--cached)} {($ VSub_Name '$rev')} {(--)} 
                      {(DQ ($ VSub_At '$@'))}
                    )
                    (C {(sed)} {(-e)} 
                      {
                        (SQ 
                          <
's/^:\\([0-7][0-7]*\\) [0-7][0-7]* \\([0-9a-f][0-9a-f]*\\) [0-9a-f][0-9a-f]* [A-Z]\t\\(.*\\)$/\\1 \\2\t\\3/'
                          >
                        )
                      }
                    )
                    (C {(git)} {(update-index)} {(--add)} {(--remove)} {(--index-info)})
                  ]
                  negated: F
                )
                (ControlFlow token:<ControlFlow_Exit exit>)
              ]
            )
            (C {(git)} {(update-index)} {(--refresh)})
            (ControlFlow token:<ControlFlow_Exit exit>)
          ]
          spids: [16777215 215]
        )
      ]
      spids: [16777215 295]
    )
    (C {(cd_to_toplevel)})
    (If
      arms: [
        (if_arm
          cond: [(C {(test)} {(DQ ($ VSub_Name '$reset_type'))} {(Lit_Other '=')} {(DQ (--hard))})]
          action: [
            (Assignment
              keyword: Assign_None
              pairs: [(assign_pair lhs:(LhsName name:update) op:Equal rhs:{(-u)} spids:[318])]
              spids: [318]
            )
          ]
          spids: [16777215 315]
        )
      ]
      spids: [16777215 321]
    )
    (If
      arms: [
        (if_arm
          cond: [(C {(test)} {(DQ ($ VSub_Name '$reset_type'))} {(Lit_Other '=')} {(DQ (--soft))})]
          action: [
            (If
              arms: [
                (if_arm
                  cond: [
                    (AndOr
                      ops: [Op_DPipe]
                      children: [
                        (C {(test)} {(-f)} {(DQ ($ VSub_Name '$GIT_DIR') (/MERGE_HEAD))})
                        (C {(test)} {(DQ )} {(KW_Bang '!') (Lit_Other '=')} 
                          {
                            (DQ 
                              (CommandSubPart
                                command_list: 
                                  (CommandList
                                    children: [(C {(git)} {(ls-files)} {(--unmerged)})]
                                  )
                                left_token: <Left_CommandSub '$('>
                                spids: [373 379]
                              )
                            )
                          }
                        )
                      ]
                    )
                  ]
                  action: [(C {(die)} {(DQ ('Cannot do a soft reset in the middle of a merge.'))})]
                  spids: [16777215 383]
                )
              ]
              spids: [16777215 393]
            )
          ]
          spids: [16777215 347]
        )
      ]
      else_action: [
        (AndOr
          ops: [Op_DPipe]
          children: [
            (C {(git)} {(read-tree)} {(-v)} {(--reset)} {($ VSub_Name '$update')} 
              {(DQ ($ VSub_Name '$rev'))}
            )
            (ControlFlow token:<ControlFlow_Exit exit>)
          ]
        )
      ]
      spids: [395 416]
    )
    (If
      arms: [
        (if_arm
          cond: [
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:orig)
                  op: Equal
                  rhs: 
                    {
                      (CommandSubPart
                        command_list: 
                          (CommandList
                            children: [
                              (SimpleCommand
                                words: [{(git)} {(rev-parse)} {(--verify)} {(HEAD)}]
                                redirects: [
                                  (Redir
                                    op_id: Redir_Great
                                    fd: 2
                                    arg_word: {(/dev/null)}
                                    spids: [434]
                                  )
                                ]
                              )
                            ]
                          )
                        left_token: <Left_CommandSub '$('>
                        spids: [425 436]
                      )
                    }
                  spids: [424]
                )
              ]
              spids: [424]
            )
          ]
          action: [
            (SimpleCommand
              words: [{(echo)} {(DQ ($ VSub_Name '$orig'))}]
              redirects: [
                (Redir
                  op_id: Redir_Great
                  fd: 16777215
                  arg_word: {(DQ ($ VSub_Name '$GIT_DIR') (/ORIG_HEAD))}
                  spids: [447]
                )
              ]
            )
          ]
          spids: [16777215 438]
        )
      ]
      else_action: [(C {(rm)} {(-f)} {(DQ ($ VSub_Name '$GIT_DIR') (/ORIG_HEAD))})]
      spids: [453 465]
    )
    (C {(git)} {(update-ref)} {(-m)} {(DQ ($ VSub_Name '$GIT_REFLOG_ACTION'))} {(HEAD)} 
      {(DQ ($ VSub_Name '$rev'))}
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:update_ref_status)
          op: Equal
          rhs: {($ VSub_QMark '$?')}
          spids: [483]
        )
      ]
      spids: [483]
    )
    (Case
      to_match: {(DQ ($ VSub_Name '$reset_type'))}
      arms: [
        (case_arm
          pat_list: [{(--hard)}]
          action: [
            (AndOr
              ops: [Op_DAmp]
              children: [
                (C {(test)} {($ VSub_Name '$update_ref_status')} {(Lit_Other '=')} {(0)})
                (BraceGroup
                  children: [
                    (C {(printf)} {(DQ ('HEAD is now at '))})
                    (SimpleCommand
                      words: [
                        {(git)}
                        {(log)}
                        {(--max-count) (Lit_Other '=') (1)}
                        {(--pretty) (Lit_Other '=') (oneline)}
                        {(--abbrev-commit)}
                        {(HEAD)}
                      ]
                      more_env: [(env_pair name:GIT_PAGER val:{(EmptyPart)} spids:[520])]
                    )
                  ]
                  spids: [510]
                )
              ]
            )
          ]
          spids: [495 497 544 16777215]
        )
        (case_arm pat_list:[{(--soft)}] spids:[546 548 551 16777215])
        (case_arm
          pat_list: [{(--mixed)}]
          action: [(C {(git)} {(update-index)} {(--refresh)})]
          spids: [556 558 572 16777215]
        )
      ]
      spids: [487 493 574]
    )
    (C {(rm)} {(-f)} {(DQ ($ VSub_Name '$GIT_DIR') (/MERGE_HEAD))} 
      {(DQ ($ VSub_Name '$GIT_DIR') (/rr-cache/MERGE_RR))} {(DQ ($ VSub_Name '$GIT_DIR') (/SQUASH_MSG))} {(DQ ($ VSub_Name '$GIT_DIR') (/MERGE_MSG))}
    )
    (ControlFlow token:<ControlFlow_Exit exit> arg_word:{($ VSub_Name '$update_ref_status')})
  ]
)