Continuous Deployment & Live Updates with Ionic Deploy

How this update is working? Whether its happening in device from initial commit to last commit or last but one commit to last commit ? While updating I am able to see on every update initial commit code is replacing by last commit code. Ideally it should be last but one commit code should replace by last commit code. Please clarify.