Within the first 50 seconds after you sent your units outside of the Base ( Raid / Occupation / etc.) you may cancel the action and recall the units for free.
However in order to recall the units after 50 seconds have already passed, you will need to use the "Instant Callback" item.
You may use it in the Tracking tab of your Command HQ.
If you try to recall the units without having the item you will receive the following notification:
And will be charged 300 Diamonds in case you press "Yes"
Once you do so, the "Army Callback" item will be automatically purchased and applied to recall the troops you intended to recall.