I don’t know how to make a commit to save the Larry/Laertes name swap in hamlet from the terminal can someone help me. its the 5th intruction from HOW TO BACKTRACK
In this exercise we make changes to scene-2.txt, add it to the staging area, and then unstage the file. We subsequently commit other changes.
But after the commit, I closed scene-2.txt and reopened it, and found that the changes were still present in that file.
If scene-2.txt had never been committed, how would one go about recovering the changed content in that file? In the exercise I only changed a line, but imagine that many parts had been changed in different parts of the file. Perhaps the solution is to do an initial commit to be able to restore a previous version?
I was thinking the same think as “doctorplatano”.
What happens if “scene-2.txt” has never previously been committed? How can it be “reset” from HEAD if there is nothing in HEAD?
I deleted a line. Added the file to the staging area. I un-staged the file using $ git reset HEAD scene-2.txt. I made a commit regarding the change of name. When I closed and reopened the file, the line I deleted was still gone. Please help.
this is normale bec, whit git reset HEAD filename command you are removing changes from the staging area, but those changes remain in your working directory.