Thousands of Palestinians are returning to north Gaza after Israel and Hamas reached a hostage deal.