If you believe the investment to still be worth holding, then you can buy the stock back after 31 days and continue to hold it, but you get to take the loss in the current year on your taxes. You've, in effect, bought down your cost basis. 

If you do not believe the stock to be worth holding any more, then you can use to losses to offset other gains, or just take some money off your taxes. In this case, yes you've lost the money. 

Most people who refer to tax-loss-harvesting actually mean the first thing: they buy back after the lockout period at the lower price.

With respect to charitable giving of stocks: read The Only Investment Guide You'll Ever Need to see why giving an appreciated stock is actually much more beneficial than selling the stock and giving the proceeds. It's more than just the tax deduction on the full amount. I have a hard time explaining it, but the numbers in the book make it clear.