Man accused of shooting deputies testifies in retrial