If a man robs a child born out of wedlock, he can negotiate with him. If the negotiation fails, he can directly file a lawsuit with the people's court. If the people's court decides which party should take care of the child, the custody right shall be implemented according to the judgment. If it is awarded to the woman, the man shall give the child to the woman for custody according to the law and the judgment.
Legal basis:
Article 1084 of the Civil Code of the People's Republic of China
The relationship between parents and children shall not be eliminated by the divorce of parents. After divorce, whether the children are directly raised by the father or the mother, they are still children of both parents.
After divorce, parents still have the right and obligation to support, educate and protect their children.
After divorce, children under the age of two shall be directly supported by their mothers in principle. If both parents fail to reach an agreement on the upbringing of a child who has reached the age of two, the people's court shall make a judgment on the basis of the specific circumstances of both parties and the principle that it is most beneficial to the minor children. If a child has reached the age of eight, his or her true wishes shall be respected.