Collision - Move player back to previous position?

Aight. So i got this player, and this tree. They’re both kinematic rigidbodies. So I had to script collision detection myself. Now my idea was to move the player back the previous position. So I decided to move the player 1 unit back. That’s gives a jitter effect, which I don’t want. I know there’s a better way to do this, but I just can’t seem to get it… any help?

Here’s what I tried, by the way. Thanks!

	void OnTriggerEnter(Collider other) {
		if (lastMove == KeyCode.W) {
			transform.Translate (0.0f, 0.0f, -0.5f);
		} else if (lastMove == KeyCode.S) {
			transform.Translate(0.0f, 0.0f, 0.5f);
		}
	}

Try this:

    [SerializeField]
    private Rigidbody rb;

    private void OnTriggerEnter(Collider coll)
    {
        transform.Translate(-rb.velocity);
    }