Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.


+12 votes
asked in CSC305 Fall 2023 by (1 point)

3 Answers

+4 votes

I believe you can use git reset --hard HEAD which would delete uncommitted code. Or you could use git reset --soft HEAD which will reset the staging area back to the last commit but keep your code in the working directory that way you can commit your code later if needed.

answered by (1 point)
+4 votes

What I do is "git restore ." , then "git stash". I think you type "git stash -A" but I'm not certain. You should type "git restore ."with the period because that will restore all the files that you have been working on. It's a lot easier to add the period instead of the file name because it does all of it for you.

answered by (1 point)
+2 votes

i just do git reset --hard HEAD or git reset --hard

answered by (2.3k points)