On this page of the NieR Automata game guide, we explain how to return to the factory from the campaign prologue. The main reason to return is to recover equipment from the prologue, but you might also want to finish side quests that need to be completed near the factory.
The following walkthrough contains spoilers about events that occur in the game's prologue. We advise you to continue reading only once you have completed the campaign's prologue, that is, after leaving the factory where all the initial battles are fought.
You will spend approximately the first hour of the game in the factory. It will teach you some basic mechanics and you will take part in a series of battles. While in the factory, you won't be able to explore the rest of the world.
In addition to fights against regular opponents in the prologue, you will also have to fight a goliath. Upon defeating the machine, the characters will be surrounded by other goliaths and decide to detonate a kind of bomb that will result in their "deaths". Once you appear in the bunker, you will lose the equipment you had in the prologue. It will remain on the body in the factory and the game will let you return to the location of the first boss fight to search 2B's body and recover all the equipment from the prologue.
Returning to the factory for equipment
You can choose to return to the factory as soon as you leave the bunker and reach the City Ruins. Once in the area of the ruins, seek out the location from the above screenshots. You can jump on the truck and then keep double jumping until you reach the destroyed bridge.
Head straight for the damaged bridge, as it will allow you to reach the vicinity of the factory. You should, of course, activate the Access Point that you find here so that you will be able to fast travel to this location later in the game.
Near the access point there are stairs and a fairly linear path will lead you to the place where you fought against the goliath earlier.
Search for the Virtuous Treaty katana that is stuck in the ground. It will be added to your inventory and you will be able to use it later in the campaign.
There's also a body nearby. You can interact with it and recover the equipment you had during the prologue.