I have staged two files file1.js
and file2.js
but I only want to commit file2.js
. How can I do this?
No need to unstage file1.js
(assuming you want to keep the changes in this file staged for the next commit), just enter
git commit file2.js
to only commit the changes recorded in file2.js
.
Simplest solution: unstage the other (git status tells you how, git reset
).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With