Whenever I have finished cooking/chopping with garlic and/or onion, I am always left with the odor on my hands. The remedy is to rub your hands with lemon juice or vinegar, whichever you have around.
Then wash your hands as your normally would. I wash my hands with dish washing liquid (just to be sure) and its goodbye to the horrible odor.
As a last thing I would suggest putting hand lotion on as lemon juice/vinegar are acidic and can dry your hands. Not that it's noticeable in one use.