Magnetization reversal or switching is the process by which the magnetization of a specimen is changed from one stable direction into another. Switching the magnetization of a magnetic bit through the flipping of a soliton offers the possibility of developing a new innovative approach for data storage technologies. The spin dynamics of a site-dependent ferromagnet with the antisymmetric Dzyaloshinskii-Moriya interaction is governed by a generalized inhomogeneous higher order nonlinear Schrödinger equation. We demonstrate the magnetization reversal through the flipping of a soliton in the ferromagnetic medium by solving numerically the two coupled evolution equations for the velocity and amplitude of the soliton using the fourth order Runge-Kutta method. We propose a new approach for inducing the flipping behaviour of a soliton in the presence of an inhomogeneity by tuning the parameter associated with the Dzyaloshinskii-Moriya interaction, which causes the soliton to move with constant velocity and amplitude along the spin lattice.