When we think about God we have a tendency toward anthropomorphism. Confusion about God is the result of assuming God would think like you and act like us (humans). God is not subject to any of the limitations of human concepts of time, space or the material world. We humans are immersed in it and so our vision is limited.
God created time, space and matter. Consequently you can think of the time-space continuum like a giant spreadsheet laid out before God. God simultaneously sees the beginning and the end and all things in between. At any point in time He can see where all matter is at that moment and has complete control.
One of the strangest things that God says about Himself is when He uses the term “I Am” to describe his existence in the past, present and future. In the book of John He says: “I tell you the truth, before Abraham was even born, I am!” This is not God using improper grammar. He is correctly identifying His existence as timeless and eternal.
The world we live in was not created to be our final home. It is a world where God has allowed us to see what it is like if we choose to live without Him. That means sin and calamities will abound and we will collectively suffer the consequences.
Many have railed against God for creating this condition but it is really of our own making. But God wants us to see that this world is not where we belong. This world certainly has its pleasures but those pleasures only serve to provide a contrast to the negative consequences of sin.
God uses the backdrop of pain and suffering in this world to offer us a reprieve and to guide us toward hope. God knew all the bad things that would happen as a result of allowing people to make choices independent of Him. But he allowed those things to happen so that we would be able to see the stark contrast between life and eternity with Him or without Him.
God has in a way, changed the past but not to bring about a different outcome from one He did not see coming or did not like. The past and the future are all part of one big tapestry that He has woven. He designed the past and the future and so in that sense He has “changed” the past. But only so far as it fits in with His perfect plan which cannot be altered or changed by us.