A single force cannot be repulsive or attractive by itself. It takes two. But a single force can be positive or negative once the direction of displacement has been defined. If the force generates an acceleration in the direction of displacement, \(x\), that the force is positive. If, however, the force generates an acceleration directly opposite to the direction of \(x\) then it is negative.
\(a=\pm \cfrac{d^2x}{dt^2}=\pm\cfrac{dv}{dt}=\pm\cfrac{d}{dt}(\cfrac{dx}{dt})\)
These diagrams also indicate why a pair of attractive forces are positive and a pair of repulsive forces are negative. In such cases, the distances being indicated \(x\), are between the two bodies concerned.