Guest late cancellation

We had a guest book online, come to the hotel, but the rooms they booked were all full, so we had to give them a different room, but now we cannot cancel their online booking, and they also cannot cancel, so how can we change the booking to match what actually happen?