Can you recover a file after removing the file using git?
Suppose I am in branch 1, commit file1, and then checkout branch 2 from branch 1. On branch 2, I use git rm file1. If I go back to branch 1 (git checkout branch 1), will I get file1 back?
will I get file1 back?
Yes, of course. It's part of branch 1, and you haven't merged branch 2 into branch 1, so the file still exists in branch 1.