XYZ rises to $45 at expiration
If XYZ has increased and closes at $45 at expiration, the investor's short 45 calls will expire exactly at-the-money and with no value. However, the investor's long calls will be in-the-money and worth $5. If the long call is sold the investor will have a net $5 option profit, keeping in mind that the repair strategy was established for no cost. On the long stock position, with XYZ at $45 the unrealized loss on the shares originally purchased at $50 will be reduced to $5. Taking this $5 stock loss and the $5 profit on the option position, the investor breaks even on the overall position.
Notice that what the investor has succeeded in doing is reducing the break-even point on his stock position from the shares' initial cost of $50 to a lower XYZ stock price of $45. In other words, the repair strategy does not need the underlying stock to at least partially recover over the original stock purchase price in order to obtain the desired result - breaking even on the overall stock repair position.