Does Mac keeps a history of all actions I have done with files/folders similar to terminal?
To your first question:

Yes it does keep record of lots of stuff--lots of records.

Open the Console log and have fun looking through it.

To your other questions:

Only if you realize the mistake immediately some stuff is recoverable.

It also depends how full your disk is (theoretically), so the deleted information would not be immediately overwritten.