A team cannot reacquire a player it traded away during the same season (a season for this purpose being defined as starting on the first day of he regular season and ending on the last day of the Finals). If the player was traded between seasons (i.e., from the first day after the Finals to the last day prior to the start of the next regular season), it cannot reacquire the player prior to the end of the next season. If he is waived by his new team, then he cannot re-sign with his original team until the one-year anniversary of the trade, or until the July 1 following the end of his contract, whichever comes first. However, if a team trades a player's draft rights, it can reacquire the player during the same season.
Interestingly, a player can be traded to a third team, waived by the third team, and be eligible to re-sign with his original team before the waiting period expires. While this has not happened in practice, the league clarified its interpretation of this rule in 2017, in regard to a possible instance with Andrew Bogut.