It's okay; we all make that mistake one time or another. Most importantly, you don't have to be an all or nothing investor. Fortunately, you're young and I hate it a lot more when it happens to someone older since time is not on their side. My suggestions for someone that age would likely be much different (change the asset allocation rather than selling). I think there are two lessons you can take out of this: 1) you want to always have 8 months to 1 year of an emergency fund (probably more in India because the fees of mutual funds are higher and if you lose your shirt, it can permanently change your standard of living) and 2) you will always want to be well diversified. Also, 3) you want to be buying now and not selling, but you are in a predicament whereby you have to sell to replenish the emergency fund.
At least you're a software engineer. Here's what I think you should do. It's just a suggestion as I think the global markets (maybe not the Indian or China economy) will come roaring back especially after 2010. I wouldn't sell all but I'd sell half of the investments. That will give you $6,000 in cash and $6,000 in stocks. That's just in case you lost your job as a software engineer. You then go back and put $200 per month. Meanwhile, you save at least $100 per month into savings. $200/month or more into savings would be much better. In 30 months, you might have $15,000 in stocks and $10,000 in savings. You might want to sit down with a financial planner and discuss your situation at that time.
So what should you invest in? You live in India, thus you don't want the risk of your currency, the risk of losing your job, and the risk of the stock market all at once. I don't know if that means you have risk from other emerging markets or China. So I'd try to be international in my investment selections.
One place I like very much is Brazil. It's got a sugar ethanol and it stayed in a recession for a long time in hopes to build its economy.
The second place I like very much is Asia. Since you live in India, it makes it more difficult and I might not want to take this suggestion. I really like countries like Taiwan, Singapore, and Russia in the Asian quadrant. I also would like Australia.
The third place I like is the United States. Valuations look good; the market could fall 20% or more, but it looks like it has good long-term prospects (for the next 3-5 years or so). The market should do well. Be very wary of the subprime mess becoming a problem again in 5 years as they are set to reset. That could be especially troubling if our economy is doing well but starting to slow and Feds Funds rises. In other words, those things could perpetuate a severe recession and dramatically lower stock prices from where they reach their peak so I'd pay attention for the Feds Funds rate, economic sediment, housing, and the value of the stock market. The higher the value of the stock market, the more worried I'd be as an international investor. Just take a look at China and India; they have had very severe declines and I think it will continue. If you disagree, please include in the note since I want to learn more about the Indian and possibly the Chinese economies.