For Freud, "...the essence of repression lies simply in the turning something away, and keeping it at a distance, from the conscious." (Sigmund Freud, "Repression" 1915) Freud's early writings described repression as the intentional rejection of distressing thoughts and memories from consious awareness. But his idea changed gradually over time, and Freud began to use the term repression in a much more general sense, to refer to a variety of defense mechanisms that operate outside a person's awareness and automatically exclude threatening material from consciousness. While repression is often equated with defense, repression is more a mode or moment in defense. ( Abwehr ) When Freud referred to repression as "the foundation stone on which the whole structure of psychoanalysis rests," he was referring to a multiplicity of specific techniques, of mechanisms that include Denial, Repression, Reaction Formation, Rationalization, Humor, and Projection. In Inhibitions, Symptoms, and Anxiety (1926) Freud sought to clarify the confusion between the narrow meanings of repression and the broader concept of defense. 

In its concise form, repression is a mechanism of defense by which the ego keeps itself relatively free of tension and conflict, primarily by separating affect and idea. According to Freud, the affect cannot become unconscious in any strict sense. Only the the "ideational representatives" of the instinct, such as ideas and images, can be repressed. Unlike sublimation, repression runs counter to instinctual drives. Repression excludes disturbing instinctual impulses and their proximate derivatives by means of keeping them, or rendering them, unconscious. But repressed impulses, although repudiated or blocked by the ego, tend not to disappear altogether for long. Rather, they find substitute gratifications and expressions, in compromise formations such as dreams and symptoms such as "reaction formations." eg. "Methinks the lady doth protest too much."

see the " return of the repressed." (see parapraxis
see also ressentiment . 

references for further reading: 
B.P. Jones, "Repression: the Evolution of a Psychoanalytic concept from the 1890's to the 1990's" Journal of the American Psychoanalytic Association, 41, 63-93 (1993)