Skip to content

Instantly share code, notes, and snippets.

@kumarsonsoff3
Last active September 14, 2023 05:23
Show Gist options
  • Save kumarsonsoff3/fbc6ecde519250a9f0a4d7ccc9993a1a to your computer and use it in GitHub Desktop.
Save kumarsonsoff3/fbc6ecde519250a9f0a4d7ccc9993a1a to your computer and use it in GitHub Desktop.
Explained the easiest ways to revert the changes in package-lock.json file! This Gist is specially created for the contributors for the EddieHub LinkFree Project!

While contributing to open-source, we often encounter an issue that leads to changes in the package-lock.json file, and maintainer or the owners of the repository may ask you to Revert those changes in the package-lock.json file while reviewing your PR.

Eventhough you've not committed anything in your package-lock.json file, but since you run NPM when you start, it automatically updates the package version to the latest. It then sometimes leads to conflicts with the main branch, or distrubs the workflows in somecases!

Remember to only commit the file you're making changes in!

How to revert those?

Method - 1 (Click Here to view a video demo)

  • Go to Files changed section in your PR image
  • Check what changes are made in package-lock.json file. gist asset
  • Go to Editor, and revert the changes back to initials
  • Good to go now! 🎉

Method - 2

  • Copy whole content from the base branch.
  • Paste it in your file.
  • And, that's it! Good to goo now! 🎉

For any queries now, reply me below!
@frizar
Copy link

frizar commented Sep 14, 2023

🤡

@frizar
Copy link

frizar commented Sep 14, 2023

git checkout master -- package-lock.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment