0

So a while ago, I accidentally made a commit in which my package-lock file got deleted, resulting in 20,000 lines being deleted:

enter image description here

This has resulted in my deleted lines for my pull request to be highly inflated, which I do not want:

enter image description here

Is there any way to remove this commit and make it so that the deletions do not show up inflated like this? If the commit can't be deleted, is there another way to do this?

Pradip Dhakal
  • 1,872
  • 1
  • 12
  • 29
  • Does this answer your question? [How do I undo the most recent local commits in Git?](https://stackoverflow.com/questions/927358/how-do-i-undo-the-most-recent-local-commits-in-git) – match Nov 16 '21 at 11:51

1 Answers1

0

there are certain way to do so 1: you can revert your latest commit to your previous commit

git reset HEAD~ 

for more info check git documentations

2: you can go to the last commit through git app (github, bitbucket etc) and copy the package-lock.json and in latest commit just create new file ad

Bilal Khursheed
  • 728
  • 1
  • 5
  • 12
  • That seems to work when you need to revert the most recent commit, but this commit that I need to remove went unnoticed for a while, and since then, more important commits have been added, so I need a solution to pick out an old commit – Siddu Palaparthi Nov 17 '21 at 05:55