This practice was only mentioned once in the Sefer HaRebbe HaKadosh, but stood out me. The practice has a long history in Christianity and Islam, but I have heard little of it in Judaism.
The Sefer mentions that self-flagellation was a common practice among “Ovdei Hashem” (servants of God) during the 9 Days, a period each summer when Jews mourn the destruction of the first and second Temple.
In his later years, Reb Arele would visit baths and spas throughout rural areas of Europe each summer. His doctors recommended visiting such places for the sake of his health. While there, he would head out to the forests each day and daven. In addition, he would often grab branches and beat himself. He considered this practice a form of Tshuva (repentance) and believed that it gave him a “tikkun” for his soul.
It’s important to note that Reb Arele did not advocate these sorts of practices for his followers and instead warned against them.