Applying changes from a branch to main reset all uncommitted changes

I currently have 2 branches (including the main branch). I’ve not updated the main branch for 5 months, the other for 2 months (I was very lazy :frowning: ). Today, I have just finished up the new system and wanted to commit it. First I tried to update all the changes from the second branch to the main branch. But doing so somehow revert all changes I make on the machine to 2 months ago before I could commit it. Are there any ways to undo that?

@longtran2904 welcome! Just to confirm, are you using GitHub Desktop? Were you trying to merge with uncommitted changes in your working directory?

If you can open the command line and share the output of git reflog that may give us a better idea of what happened.

Sorry for the late reply. Luckily, It still in the stash in the second branch. I was just very inexperienced with git. It was my fault.