0

I've deleted my composer.lock file and didn't commit yet.

git checkout -- composer.lock

gives

error: pathspec 'composer.lock' did not match any file(s) known to git.

How do I restore the composer.lock file?

Nicolai Fröhlich
  • 51,330
  • 11
  • 126
  • 130
ogbofjnr
  • 1,688
  • 5
  • 19
  • 41
  • I suggest googling the error message. For example, I found this: https://stackoverflow.com/questions/33628862/git-error-pathspec-xxx-did-not-match-any-files-known-to-git – Code-Apprentice Aug 08 '19 at 16:21
  • Is your `composer.lock` being ignored in the `.gitignore` file? Did you add and commit `composer.lock` at least once before? – Nicolai Fröhlich Aug 08 '19 at 16:24

1 Answers1

1

Try git reset -- composer.lock

Also this a duplicate of this exact question. Please look here to get better insight.

Cheers

tripathiakshit
  • 624
  • 5
  • 17