In the common law theft is usually defined as the unauthorised taking or use of someone else's property with the intent to deprive the owner or the person with rightful possession of that property or its use.
As with other common law crimes, it is composed of two elements, the actus reus — the unauthorized taking or use — and the intent to deprive — the mens reas. Thus if one goes to a restaurant and by accident one takes someone else's hat or scarf instead of one's own hat or scarf, one has deprived someone of the use of their property and has taken the other person's property in an unauthorized manner, but without the intent to deprive the person (hum, this is a much nicer scarf than mine or he'll never notice the spot on the hat until he gets home) there is no criminal act (actus reus) and thus no crime. Note that there may be civil liability, by depriving someone of their property you may be liable for damages in a civil court, but without proof of your intent to deprive, no criminal act has occurred.
See also: motor vehicle theft