East Pikeland Township police say 25-year-old Justin Carbone, of Phoenixville, accidentally dropped the drugs inside a Kimberton credit union earlier this week.
Police used the check Carbone cashed to track him down shortly after bank personnel discovered the drugs. When an officer pulled up to Carbone and asked him if he'd lost anything in the bank, police say he replied "two bags of heroin."
Carbone was released Monday on $10,000 unsecured bail and is due in court again next month.
A phone listing for Carbone could not be found.
Information from: The Mercury