when I started out, I still lived 25mi from work, so I drove to work with my bike and clothes to change into to ride home, and clothes to wear for work the next day. Then I rode home 25mi (2hr), rested, and rode back in the morning, and drove everything home that night. I am fortunate to have not just lockers but also showers at work, so it worked out great.
Eventually I moved closer to work specifically so I could bike-commute full time. I'm 5.5mi from work now. By that time I was used to showering and changing at work, so it wasn't a big deal; rather it was easier to handle the shorter distance.
It is a very common recommendation though, to do a dry-run ride on a non-work-day, so you can scope out any potential trouble spots, and when you get home research alternate routes (parallel side-streets etc)