I have a file name
I have made some changes in the
I commit and push these changes.
But now I realize that I don’t need any change in the file in the current branch. So mistakenly I have done
git rm file.txt. And then commit and pushed these deletion changes. But it is showing removed this file on my branch.
All I want is that I don’t want to see any change in the
file.txt in my branch.
Could anyone please help me here? I have searched on StackOverflow a lot. There are many answers but could not find my case.
So finally, I got the answers that I want. Here is the steps that I followed.
git checkout deletion_commit_id^ -- file.txt
This will reverted the deletion and then
After that, I have done undoing of all the changes of this file.
git checkout origin/master file.txt.
Answered By – starboy_jb