Cycle slip detection for single frequency Global Navigation Satellite System (GNSS) data is currently mainly based on measurement modelling or prediction, which cannot be effectively performed for kinematic applications and it is difficult to detect or repair small cycle slips such as half-cycle slips. In this paper, a new method that is based on the total differential of ambiguity and Least-Squares Adjustment (LSA) for cycle slip detection and repair is introduced and validated. This method utilises only carrier-phase observations to build an ambiguity function. LSA is then conducted for detecting and repairing cycle slips, where the coordinate and cycle slips are obtained successively. The performance of this method is assessed through processing short and long baselines in static and kinematic modes and the impact of linearization and atmospheric errors are analysed at the same time under a controlled variable method. The results indicate this method is very effective and reliable in detecting and repairing multiple cycle slips, especially small cycle slips.