When Jesus died on the cross he said "Father into thy hands I give my spirit". So what is this spirit which Jesus gave to Father? Surely Jesus body was in the grave.
The verse you quote states the answer. "Father, 'into Your hands I commit My spirit" (Luke 23:46).
Paul indicates that humans are composed of three things: "Now may the God of peace Himself sanctify you completely; and may your whole spirit, soul, and body be preserved blameless at the coming of our Lord Jesus Christ" (I Thessalonians 5:23). Your body is the physical container. Your spirit is that which makes you an individual. Your soul is your life.
Jesus stated that God is spirit (John 4:24) and since Jesus is a part of the Godhead (John 1:1), the spirit of God, the Son, came in human form to this world. When Jesus died, he experienced what all humans experienced. "Then the dust will return to the earth as it was, And the spirit will return to God who gave it" (Ecclesiastes 12:7).