A washing machine comprising: a tub for storing water; a drum rotatably provided in the tub; a driving unit rotating the drum; a water supply unit supplying water supplied from an external water source to the tub; a pump having a pump motor and pressure-feeding water discharged from the tub; a nozzle spraying the water pressure-fed by the pump into the drum; a heater heating the water in the tub; and a controller controlling the driving unit, the water supply unit, the pump motor, and the heater, wherein the controller: controls the water supply unit to supply water with a detergent by a first set amount to the tub, controls the driving unit to rotate the drum at a first drum rotation speed while water is being supplied, and performs an operation of accelerating a rotation speed of the pump motor from a first pump rotation speed to a second pump rotation speed and then decelerating to the first pump rotation speed at least once during the rotation of the drum, characterised in that the controller further operates the heater in a state in which the first set amount of water is supplied to the tub, controls the driving unit to rotate the drum at a second drum rotation speed during the operation of the heater, and rotates the pump motor at a third pump rotation speed during the rotation of the drum at the second drum rotation speed, controls the driving unit to rotate the drum at the second drum rotation speed, then control the driving unit to rotate the drum at a preset spin-drying speed, and controls the pump to be operated in a drain mode to discharge the water through a drain pipe, and controls the driving unit so that the drum is rotated at a third drum rotation speed, while supplying water into the tub after rotating the drum at the spin-drying speed, and performs an operation of accelerating a rotation speed of the pump motor from the first pump rotation speed to the second pump rotation speed and then decelerating to the first pump rotation speed during the rotation of the drum at the third drum rotation speed, at least once. a tub for storing water; a drum rotatably provided in the tub; a driving unit rotating the drum; a water supply unit supplying water supplied from an external water source to the tub; a pump having a pump motor and pressure-feeding water discharged from the tub; a nozzle spraying the water pressure-fed by the pump into the drum; a heater heating the water in the tub; and a controller controlling the driving unit, the water supply unit, the pump motor, and the heater, wherein the controller: controls the water supply unit to supply water with a detergent by a first set amount to the tub, controls the driving unit to rotate the drum at a first drum rotation speed while water is being supplied, and performs an operation of accelerating a rotation speed of the pump motor from a first pump rotation speed to a second pump rotation speed and then decelerating to the first pump rotation speed at least once during the rotation of the drum, characterised in that the controller further operates the heater in a state in which the first set amount of water is supplied to the tub, controls the driving unit to rotate the drum at a second drum rotation speed during the operation of the heater, and rotates the pump motor at a third pump rotation speed during the rotation of the drum at the second drum rotation speed, controls the driving unit to rotate the drum at the second drum rotation speed, then control the driving unit to rotate the drum at a preset spin-drying speed, and controls the pump to be operated in a drain mode to discharge the water through a drain pipe, and controls the driving unit so that the drum is rotated at a third drum rotation speed, while supplying water into the tub after rotating the drum at the spin-drying speed, and performs an operation of accelerating a rotation speed of the pump motor from the first pump rotation speed to the second pump rotation speed and then decelerating to the first pump rotation speed during the rotation of the drum at the third drum rotation speed, at least once. controls the water supply unit to supply water with a detergent by a first set amount to the tub, controls the driving unit to rotate the drum at a first drum rotation speed while water is being supplied, and performs an operation of accelerating a rotation speed of the pump motor from a first pump rotation speed to a second pump rotation speed and then decelerating to the first pump rotation speed at least once during the rotation of the drum, characterised in that the controller further operates the heater in a state in which the first set amount of water is supplied to the tub, controls the driving unit to rotate the drum at a second drum rotation speed during the operation of the heater, and rotates the pump motor at a third pump rotation speed during the rotation of the drum at the second drum rotation speed, controls the driving unit to rotate the drum at the second drum rotation speed, then control the driving unit to rotate the drum at a preset spin-drying speed, and controls the pump to be operated in a drain mode to discharge the water through a drain pipe, and controls the driving unit so that the drum is rotated at a third drum rotation speed, while supplying water into the tub after rotating the drum at the spin-drying speed, and performs an operation of accelerating a rotation speed of the pump motor from the first pump rotation speed to the second pump rotation speed and then decelerating to the first pump rotation speed during the rotation of the drum at the third drum rotation speed, at least once.