How to restore an accidentally deleted file and folder in git after push. Below is the scenario.
Now, can I restore the deleted file, along with history and then push back to repo.
Sure, just check it out from a commit where it existed. If the commit that deleted the file is the tip of whatever you have currently checked out, that’s HEAD^
(the commit before last):
git checkout HEAD^ -- path/to/file
Then you can commit and push it.