First off, assess what you were doing before your units seemingly got lost. The only action that can lead to the deletion of your troops is by disbanding the army that they were assigned to while some if not all, units were still injured/not fully healed. Injured troops are then deleted. But no worries, a pop-up is usually shown before you can disband your army when they are still injured.
 
Please take note: The game will never delete any unit/s on its own unless you (the player) agree to the action. If you didn’t disband your army while they were injured, then here are some instances wherein it might seem like you lost some units even though you didn’t:
  • Your auto-fill in your garrison is on. This allows the game to automatically take some fully healed units from your armies to fill platforms and watchtowers after an attack.
  • You just finished shuffling your army, making you think you have more of what you have.
  • You recently upgraded your barracks, thus making you add more units to your armies due to the increase in slots. Making you have fewer troops available to fill in your garrison. (or vice versa)

You may try relaunching your game app first after a city defense.