If there is no bike lane and you need to ride in the opposite direction, you should walk your bike on the sidewalk or find an alternative route that allows you to ride in the correct direction of traffic.