In chapter 8 of Joshua, Israel is asked by God to comeback to the place of a recent defeat. In doing so, they grow as a people and experience the victory God had planned for them. We can learn from them about coming back to God after sin deals us a loss.