Genesis 35:1

And God said unto Jacob, Arise, go up to Beth-el, and dwell there: and make there an altar unto God, that appeared unto thee when thou fleddest from the face of Esau thy brother.

The command was given when Jacob was in distress and in danger after his sons' violence at Shechem, as he reproved them and feared that the surrounding nations in their indignation would destroy him and his house. The attack on the Shechemites was a cruel and revengeful act that God did not sanction and that Jacob did not know about until it was done. God directed him to arise, go back to Bethel, dwell there, and build an altar to the God who had appeared to him when he fled from the face of Esau his brother.

Bethel recalled God's vision and promises of mercy to Jacob and Jacob's vow to serve Him, and recalling God's care during his earlier flight softened Jacob's heart and moved his children as well. The command called Jacob back to humble himself and his household, to require them to humble themselves, put away their idols, lay off their ornaments, and prepare for worship. It further called him to make atonement for their sins by sacrifice so that God would be entreated for them, protect them, and not leave them to be destroyed.

God accepted Jacob's effort to remove the wrong and idolatry from his family, appeared to him, blessed him, and renewed the promise to him because his fear was before Him.