Nate Soares, director of the Machine Intelligence Research Institute in Berkeley, has a great series of posts on guilt.
The purpose of guilt, he says, can only be to change the course of your future such that you won’t make the same mistakes you made in the past. So when you feel guilt, you should
…check what regretted action caused the guilt, check what pattern of behavior led to the regretted action, mark down a note about which cognitive pattern needs to be reprogrammed, and then dismiss the guilt (which has now served its purpose). [From Be a New Homunculus]
If there is no regretted action to cause the guilt, or if you’ve already identified and reprogrammed the cognitive pattern that caused that led to the behavior, then your feeling of guilt has and it is telling you nothing. Your job now is to let it go.