Not sure what you mean by "twisted headset", but the most likely thing is that the handlebar stem got skewed relative to the headset. If so, just loosen the stem bolt, align the handlebars, and retighten. To test the headset adjustment, (1) make sure the fork turns freely, and (2) bounce the bike on the front wheel - if you hear jiggling then the headset it too loose. A bent fork is a slight possibility, and if this is the case then the bike won't want to ride straight and it will be obvious.