Skip to main content
Removed the unnecessary semicolon and added some more info
Source Link

Try this:

git checkout [revision] . 

where [revision] is the commit hash (for example: 12345678901234567890123456789012345678ab).

Don't forget the . at the end, very important. This will apply changes to the whole tree. You should execute this command in the git project root. If you are in any sub directory, then this command only changes the files in the current directory. Then commit and you should be good.

You can undo this by

git reset --hard;hard 

that will delete all modifications from the working directory and staging area.

Try this:

git checkout [revision] . 

where [revision] is the commit hash (for example: 12345678901234567890123456789012345678ab).

Don't forget the . at the end, very important. This will apply changes to the whole tree. Then commit and you should be good.

You can undo this by

git reset --hard; 

that will delete all modifications from the working directory and staging area.

Try this:

git checkout [revision] . 

where [revision] is the commit hash (for example: 12345678901234567890123456789012345678ab).

Don't forget the . at the end, very important. This will apply changes to the whole tree. You should execute this command in the git project root. If you are in any sub directory, then this command only changes the files in the current directory. Then commit and you should be good.

You can undo this by

git reset --hard 

that will delete all modifications from the working directory and staging area.

Undoing changed to one command.
Source Link
k0pernikus
  • 67.6k
  • 78
  • 245
  • 366

Try this:

git checkout [revision] . 

where [revision] is the commit hash (for example: 12345678901234567890123456789012345678ab).

Don't forget the . at the end--very, very important. This will apply changes to the whole tree. Then commit and you should be good.

You can undo this by `git reset --hard; That

git reset --hard; 

that will removedelete all modifications from the working directory and staging area.

Try this:

git checkout [revision] . 

where [revision] is the commit hash (for example: 12345678901234567890123456789012345678ab).

Don't forget the . at the end--very important. This will apply changes to the whole tree. Then commit and you should be good.

You can undo this by `git reset --hard; That will remove all modifications from the working directory and staging area.

Try this:

git checkout [revision] . 

where [revision] is the commit hash (for example: 12345678901234567890123456789012345678ab).

Don't forget the . at the end, very important. This will apply changes to the whole tree. Then commit and you should be good.

You can undo this by

git reset --hard; 

that will delete all modifications from the working directory and staging area.

Try this:

git checkout [revision] . 

where [revision] is the commit hash (for example: 12345678901234567890123456789012345678ab).

Don't forget the . at the end--very important. This will apply changes to the whole tree. Then commit and you should be good.

You can undo this by `git reset git reset -- .; git checkout -- ..--hard; That will first remove the changes from the staging area, then remove all modifications from the working copydirectory and staging area.

Try this:

git checkout [revision] . 

where [revision] is the commit hash (for example: 12345678901234567890123456789012345678ab).

Don't forget the . at the end--very important. This will apply changes to the whole tree. Then commit and you should be good.

You can undo this by git reset -- .; git checkout -- .. That will first remove the changes from the staging area, then remove all modifications from the working copy.

Try this:

git checkout [revision] . 

where [revision] is the commit hash (for example: 12345678901234567890123456789012345678ab).

Don't forget the . at the end--very important. This will apply changes to the whole tree. Then commit and you should be good.

You can undo this by `git reset --hard; That will remove all modifications from the working directory and staging area.

Loading
Source Link
Alex Reisner
  • 29.5k
  • 6
  • 58
  • 53
Loading