CALISTOGA (CBS SF) — Jason Koch had plenty to be thankful for this Thanksgiving after a hike in the Wine County wilderness turned into a dramatic life and death battle in the blink of a eye.

Koch was injured and trapped by a large falling boulder in a heavily wooded area of Mt. St. Helena on Monday.

READ MORE: Newsom Unveils State's COVID Recovery Plan; $75B Budget Surplus To Provide For Direct Payments

“Something slams into me and I have moments of excruciating pain,” he told CBS News. “From that point on, it was like this fast labored breathing. I could barely take a breath like I was going, you know, but I couldn’t actually just taking in the full normal breath, it was all partial. So being stuck down there, I found that my left arm was stuck down under below me. I’m kind of laying with my chest sort of flat, but my hips kind of rotated sort of sideways. So it’s a really weird position to be laying in.”

It didn’t take long for Koch to realize his dire situation.

“The first thing I that occurred to me was I need to not panic,” he told CBS News’ Jamie Yuccas “And so I made myself take and slow my breathing down and try to control my heart rate, so one of the things that I learned is that if you allow yourself to panic, you make really bad decisions. So I had to get my my my breathing and my heart rate slowed down and then figure out what I was going to do.”

But then the real struggle began — How would he summon help?

“Where am I? What’s going on? How did I get stuck here?,” said Koch of the thoughts racing through his head. “How come I can’t move my head and I’ve got branches underneath me, so I’m feeling around my body trying to figure out what’s what’s where and what can I do to free myself? While I was feeling around, I found my flashlight. And so for a while I was pressing the On-Off button and flashing S.O.S. so and and after a while I got to thinking about that and realized, you know, I’m out in the middle of nowhere on the back side of the mountain. There’s nobody going to see me. There’s no hiking trails. People don’t come out this way often. I need to figure out a better way to to to get free than wait for someone to come for me.”

Visions of the movie “127 Hours” flashed through his head. In the film, James Franco plays a climber who becomes trapped and has to self amputate his arm to free himself and get help.

“I had a flashback to that movie of the guy who was trapped with his hand and that he had to cut his hand off,” he said. “And I’m like, OK, the reason why he had that was because it was in a place where nobody could find him and he knew that. And I’m like, OK, so I’m in a situation where I have no control. I’ve got to do something other than lay here and wait and pray that somebody finds me.”

So his 12-hour-long struggle to survive began. First he needed to get to his cellphone.

“I started trying to figure out how to get to my phone and what I had to do was I broke some branches and pulled them out from underneath me and then my keys, which were in my left pocket, I was able to get my keys out using my left hand, pass them over to my right hand,” he said. “Oh, wait, no, sorry. I actually reached across with my pen knife, cut my pants open, and was able to reach into the pocket and pull my phone out, so I’m trying to figure out how to use my phone when I can’t look at it.”

Finally, he was able to make a call for help, but then he needed to free himself from the boulder.

READ MORE: Asian American Attacks: San Francisco Police Investigate Two Separate Assaults Against Asian Victims on Muni Buses in Tenderloin

“My first goal was to get my helmet off my head because it was making it so I couldn’t move,” he said. “And then my backpack, which was felt like something was squeezing it somewhere so that it wouldn’t move. I couldn’t I couldn’t shift my body because it was stuck. So at that point, I started shifting my body around trying to get a position where I could reach up underneath my chin and be able to grab the the release mechanism on the chin strap.”

“So, you know, and I made a whole bunch of efforts. And finally I was like, you know what? You’re not trying hard enough. Try harder. So I’m like, I forced my hand up even harder and was able to get that pinch and popped free. And I was so elated. I was like, in your face. Right.”

But it was only the beginning.

“My face is on the ground and I have to figure out how to be able to move,” he said. “So I grabbed a tree branch or a brush branch and started digging. So I gave myself some room underneath my cheek and was able to move my head a little bit and see. And I was pushing on the rock and I saw wiggle. So I realized that I can move it. So I started digging the dirt underneath the rock and around the rock and got the rocks so that I can shove the rock into that hole that I dug. And that was what freed me. And so then I was able to bring my arms and then I was able to back backwards out of my backpack.”

The California Highway Patrol took over from there. They said they received a 911 call at 2:20 a.m. Tuesday from Koch and determined he was located near the Oat Hill Trail (east of Calistoga) in the area known as the Palisades.

Koch told the CHP he had been out hiking earlier in the afternoon when at approximately 5 p.m. a large boulder fell on him, pinning his backpack and right arm. He had injuries.

A CHP H-30 crew flew to the GPS coordinate provided by Cal Fire and located Koch utilizing their FLIR system and night vision goggles. The hiker was able to signal the helicopter using a small flashlight. He was off trail and in extremely rugged terrain.

The crew conducted an off-site landing approximately one mile from the Koch’s location. Both officers then hiked through rugged terrain to reach him and render aid.

After approximately 1 hour of hiking off trail, the crew finally reached Koch. They quickly realized that they were not going to be able to get the hiker out due to the terrain and his injuries.

Fortunately, officials said, Koch’s injuries were not life threatening and the crew determined a first light rescue was the most appropriate way to extricate him.

As the crew members on the ground waited for daylight, they built a small fire with their survival gear and warmed Koch as temperatures were in the low 30s.

MORE NEWS: CHP Seeks Driverless Tesla With Man Riding In Back Seat Along Bay Area Roads

Finally after sunrise, the crew was able hoist Koch out of the area and transport him to a waiting ambulance at the Calistoga Fairgrounds. He was then transported to a local hospital where he was recovering on Thursday.