The most complete explanation of reputation changes after post deletion is explained in the How does "Reputation" work? post at the network-wide meta.stackexchange.com site.
With regard specifically to upvoted but deleted posts, posts which have been on the site for 60 days and with a score >= 3 will not result in a loss of reputation when the post is deleted. Any deleted post not meeting those criteria will cause reputation from upvotes to be rolled back.
Like the meta.stackexchange.com answer, I'll also link to an additional official source of this info at the Stack Overflow blog.