Recovering from a search engine penalty can be difficult and time-consuming. The only way to regain rankings and get out of the penalty box is to remove all traces of black hat SEO from your site, replace low-quality content with valuable and relevant content, build new high-quality backlinks, and submit a reconsideration request to the search engine explaining the steps you’ve taken. Even then, there’s no guarantee of recovering your former rankings.