This is the first of many useful tools that will become essential in your day-to-day conversations. We will now learn how to express an action that has taken place unintentionally often with unsatisfactory results. This is primarily done by the verb 「しまう」. Let's look at an example.
康介:宿題をやった?
Kousuke: Did you do homework?
アリス:しまった!
Alice: Oh no! (I screwed up!)
When 「しまう」 is used in this sense, it is normal to attach it to the te-form of another verb to express an action that is done or happened unintentionally. As is common with this type of grammar, the tense is decided by the tense of 「しまう」.
If you want to see many more examples, look up 「しまう」 on WWWJDIC and click the [EX] link. There are over 100 examples with translations for you to enjoy.
In casual speech, the 「~てしまう」 is often substituted by 「~ちゃう」 while 「~でしまう」 is substituted by 「じゃう」. Both 「~ちゃう」 and 「~じゃう」 conjugate just like regular u-verbs.
There is yet another very colloquial version of 「~てしまう」 and 「~でしまう」 where it is replaced by 「~ちまう」 and 「~じまう」 respectively. Unlike the cuter 「~ちゃう」 and 「~じゃう」 slang, this version conjures a image of rough and coarse middle-aged man.
If you look up 「しまう」, the edict dictionary will say:
仕舞う 【しまう】 (v5u) (uk) to finish; to close; to do something completely; to put away; to put an end to;
You may want to consider this a totally separate verb from the 「しまう」 we have covered so far. Occasionally but not usually, 「しまう」 will have this meaning rather than the unintended action.