When you view an order, there is a button that allows you to cancel that order.When an order is cancelled, the order is marked as processed, cancelled and the stock is restored for each product that was ordered.
Clicking on Cancel Order brings up the next form
This is just to confirm that you want to cancel the order. If you are sure, click the Cancel Order button and the items ordered will be restored to the stock.