Skip to main content
Fix trivial typos
Source Link
Jonathan Leffler
  • 746.6k
  • 144
  • 937
  • 1.3k

For a specific file  :

  • git reset my_file.txt
  • git checkout my_file.txt

For all added files  :

  • git reset .
  • git checkout .

Note : checkout change the codes in file and move to the last updated state. reset doesn't change the codes it just reset the header.

Note: checkout changes the code in the files and moves to the last updated (committed) state. reset doesn't change the codes; it just resets the header.

For a specific file  :

  • git reset my_file.txt
  • git checkout my_file.txt

For all added files  :

  • git reset .
  • git checkout .

Note : checkout change the codes in file and move to the last updated state. reset doesn't change the codes it just reset the header.

For a specific file:

  • git reset my_file.txt
  • git checkout my_file.txt

For all added files:

  • git reset .
  • git checkout .

Note: checkout changes the code in the files and moves to the last updated (committed) state. reset doesn't change the codes; it just resets the header.

added 163 characters in body
Source Link

For a specific file :

  • git reset my_file.txt
  • git checkout my_file.txt

For all added files :

  • git reset .
  • git checkout .

Note : checkout change the codes in file and move to the last updated state. reset doesn't change the codes it just reset the header.

For a specific file :

  • git reset my_file.txt
  • git checkout my_file.txt

For all added files :

  • git reset .
  • git checkout .

For a specific file :

  • git reset my_file.txt
  • git checkout my_file.txt

For all added files :

  • git reset .
  • git checkout .

Note : checkout change the codes in file and move to the last updated state. reset doesn't change the codes it just reset the header.

added 4 characters in body
Source Link

For a specific file :

For a specific file:

  • git reset my_file.txt
  • git checkout my_file.txt
  • git reset my_file.txt

  • git checkout my_file.txt

For all added files :

For all added files:

  • git reset .
  • git checkout .
  • git reset .

  • git checkout .

For a specific file:

  • git reset my_file.txt

  • git checkout my_file.txt

For all added files:

  • git reset .

  • git checkout .

For a specific file :

  • git reset my_file.txt
  • git checkout my_file.txt

For all added files :

  • git reset .
  • git checkout .
Rollback to Revision 3 - Edit approval overridden by post owner or moderator
Source Link
Loading
Present the code as code — it makes the dots in the 'all' commands clearer.
Source Link
Jonathan Leffler
  • 746.6k
  • 144
  • 937
  • 1.3k
Loading
git,
Source Link
Loading
Source Link
Loading