I'm in a really bad situation. I wrote a lot of scripts for a project and accidentally deleted them.
I have 3 branches: master, Dev, App
I develop on the Dev branch, keep a working copy on master, and write application scripts in App. I merged Dev to master, then merged master to App. But when I did I forgot that I had deleted all my app scripts from master and Dev. So I blindly deleted all of my application scripts in App. Now, I want to go back and get those files.
To go back a commit I used
git revert HEAD~1
git rm app_*
Go to the branch you want to fix.
git checkout App
Find the commit before the files were deleted
git log --stat
Remember that SHA and reset to that SHA.
git reset --hard bada55
Repeat for the other branches. You can see what you did and the SHA of what happened using the
git reflog command. Helps find points of time that are not on the current branch history.