In music, an accidental is a note of a pitch (or pitch class) that is not a member of the scale or mode indicated by the most recently applied key signature. In musical notation, the sharp (♯), flat (♭), and natural (♮) symbols, among others, mark such notes—and those symbols are also called accidentals.

In the measure (bar) where it appears, an accidental sign raises or lowers the immediately following note (and any repetition of it in the bar) from its normal pitch, overriding sharps or flats in the key signature.

Source: Accidental (music) – Wikipedia