He will get his account back,
Why are you so sure?
once they froze the account because of illegal activities they will ask you to present yourself for questioning
Have you read what the Op said? that is exactly what is NOT happening!
and then you will not get into trouble,
Again, how do you know that?
but he will not get the amount credited through hacked account.
What hacked account? Whoever said anything of a hacked account?
Generally, these types of cases only happen when the person has exhausted the annual limit stipulated by the central bank, commercial banks are unlikely to be scrutinizing each customer's account unless they are customers who move a lot of money.
If that might be the case for the OP, then he will have to deal with another headache even if the gets away and recovers his account.
He will have to file all that as gains for trading and pay tax on income now that he has had an investigation on those funds, if it is not and the sum is small he might be indeed better simply forgetting about it.