I accidentally deposited post tax contributions from my 401k into my regular brokerage account. Can I simply transfer them into my Roth IRA as I intended?

Both the accidental and the correction transactions would be occurring in the same tax year.