How to overcome changing undergrad course/university due to failure Right after school I decided to pursue a degree in physics. It went well at first but then I started to struggle with depression and other personal issues. Eventually I started to fall behind and felt overwhelmed by the coursework, I lost my passion for the field and just felt frustrated.
I noticed it was time for a change, so after moving away and attending another university things were lightening up a bit.

Since I was too far behind in my coursework I was afraid of losing my financial support. Thankfully I was always good at programming, so I found a nice job to cover my expenses and switched fields to Applied Computer Science. Ever since then things are working out great. I got top grades, am nominated for a stipend, and even got the time to volunteer and participate at some minor research groups.

Anyways I feel bad for not being able to finish my physics degree. I feel like I completely wasted 2 years of my life and just don't know what to do/think about this. I do miss every aspect of physics now and secretly regret my decision every now and then.

Would it be reasonable to get my physics degree (at least finish the bachelor) when I am done with my current field? If not, how can one deal with the impression of failure and regret?

(English is not my first language, any edits are warmly welcomed)
Difficult times occur. This is normal. Unless you did something foolish that caused your failure (and nothing indicates you did), there is no reason to feel regret. 

You cannot control everything in your life. Whoever does not attempt anything, does not fail; people of action fail regularly. Failure is a central part of life, and there is no reason to regret attempting to study physics and then finding out it's not for you at this phase of your life. In fact, I actually recommend testing ones limits early, and knowing where they are makes one a more mature personality. Your current success is point-in-case.

And, keep in mind: limits may be expanded, albeit slowly. Therefore, my recommendation depends on whether your regret refers to ceasing to do physics itself (the topic!), or it is rather the failure to complete (the studies!) that you regret. 

If you feel that you would have liked to do physics (the topic!) after all, perhaps you can consider reactivating your studies (or add a Master's degree as suggested elsewhere). But if it is only the missed opportunity, then I recommend to notch your physics studies up as valuable experience and move on the path where you have made progress and which clearly suits you well.