When you have a cold and you lose your taste it's usually caused by nasal passages being blocked so to get your taste back when you have a cold you can try sitting in a steamy room or taking a steamy hot shower and the moisture will open up your sinuses and nasal passages.
Using a saline solution as well and staying hydrated can also help to open your nasal passages and allow you to get your taste back during a cold.