From The Art and Popular Culture Encyclopedia
"Hundreds of young men went on a rampage in Greenwich Village, shortly after 3 A.M. yesterday after a force of plain-clothes men raided a bar that the police said was well known for its homo-sexual clientele.
Thirteen persons were arrested and four policemen injured. The young men threw bricks, bottles, garbage, pennies and a parking meter at the policemen, who had a search warrant authorizing them in investigate reports that liquor was sold illegally at the bar, the Stonewall Inn, 53 Christopher Street, just off Sheridan Square."--New York Times, June 29, 1969
Being undercover is disguising one's own identity or using an assumed identity for the purposes of gaining the trust of an individual or organization to learn secret information or to gain the trust of targeted individuals in order to gain information or evidence.
A separate technique is wearing plainclothes. This method is used by police and intelligence agencies. To wear plainclothes is to wear "ordinary clothes", instead of wearing a uniform typically associated with the occupation, in order to avoid detection or identification as a member of law enforcement. Plainclothes police officers typically carry normal police equipment and identification. Police detectives are often assigned to wear plainclothes instead of the uniform typically worn by their peers.
Many countries allow the use of undercover law enforcement officers solely or primarily for the enforcement of laws against recreational use of certain drugs. Many of these officers are allowed to commit crimes if it is necessary to maintain the secrecy of the investigation or in order to collect adequate evidence for a conviction. Social advocates have criticized this practice as failing to ensure equality under the law because it grants police officers the power to commit crimes that no other citizen could commit without potential consequences.