This is why selling a portion of underwater holdings to lock in "gains" from a recent run-up is basically impossible - on the one hand, you have paid in blood for the "long-term" status of your holdings, which, when finally profitable, will be taxed at a lower rate - on the other hand, your long-term hold immediately counts for nothing if you sell and buy back in less than 30 days (because the wash rule does not discriminate between long- or short-term status), plus you re-start the clock on attaining long-term status for those new shares.
The only people that can do this without the repurcussions mentioned above are those lucky enough to already be profitable when they sell.