As an alternative solution for quick disaster recovery of backhaul/fronthaul links, in this paper, a dynamic unmanned aerial vehicles (UAV)-assisted heterogeneous (HetNet) network equipped with directional terahertz (THz) antennas is studied to solve the problem of transferring traffic of distributed small cells. To this end, we first characterize a detailed three-dimensional modeling of the dynamic UAV-assisted HetNet, and then, we formulate the problem for UAV trajectory to minimize the maximum outage probability of directional THz links. Then, using deep reinforcement learning (DRL) method, we propose an efficient algorithm to learn the optimal trajectory. Finally, using simulations, we investigate the performance of the proposed DRL-based trajectory method.